Skip to content

Commit 54a6763

Browse files
committed
Fix #134
Changes to be committed: modified: authentication/services.py
1 parent b8ed1cb commit 54a6763

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

authentication/services.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ def authenticate(self, request):
3939
user = authenticate_orcid(unverified_payload, token)
4040
if unverified_payload['iss'] == 'accounts.google.com':
4141
user = authenticate_google(token)
42-
if unverified_payload['iss'] in ['http://localhost:8080', 'https://test.portal.biochemistry.gwu.edu/', 'https://biocomputeobject.org/']:
42+
if unverified_payload['iss'] in ['http://localhost:8080', 'https://test.portal.biochemistry.gwu.edu', 'https://biocomputeobject.org']:
4343
user = authenticate_portal(unverified_payload, token)
44-
45-
return (user, token)
44+
try:
45+
return (user, token)
46+
except UnboundLocalError as exp:
47+
raise exceptions.AuthenticationFailed("Authentication failed. Token issuer not found. Please contact the site admin")
4648

4749
if type == 'Token' or type == 'TOKEN':
4850
pass

0 commit comments

Comments
 (0)