Commit d6909def authored by gab's avatar gab

added handling page in auth_receiver for non ateneo google login

parent c266ea8e
...@@ -10,7 +10,7 @@ from .forms import CustomUserCreationForm, CustomUserAuthenticationForm ...@@ -10,7 +10,7 @@ from .forms import CustomUserCreationForm, CustomUserAuthenticationForm
from django.contrib.auth.models import auth from django.contrib.auth.models import auth
from django.contrib.auth import authenticate, login, logout from django.contrib.auth import authenticate, login, logout
from django import forms
from . import models from . import models
...@@ -75,7 +75,8 @@ def auth_receiver(request): ...@@ -75,7 +75,8 @@ def auth_receiver(request):
password = user_data['sub']+'google'+user_data['name'] password = user_data['sub']+'google'+user_data['name']
logInUser = authenticate(request, email = email, password = password) logInUser = authenticate(request, email = email, password = password)
if "@ateneo.edu" not in email and "@student.ateneo.edu" not in email and "@alumni.ateneo.edu" not in email:
return HttpResponse("Your login must be an ateneo email address. Try again <a href='./login'>here</a>", status=403)
if logInUser is not None: if logInUser is not None:
pass pass
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment