Skip to content
Snippets Groups Projects
Commit d6cbae67 authored by Megan Henning's avatar Megan Henning
Browse files

Fix ldap response

parent 1cc1c288
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,12 @@ class JWTAuthProvider(AuthProvider):
def validate_code(self, code, **kwargs):
uid = self.validate_user(code)
return code, None, uid
return {
'access_token': code,
'uid': uid,
'auth_type': self.auth_type,
'expires': datetime.datetime.utcnow() + datetime.timedelta(hours=1)
}
def validate_user(self, token):
r = requests.post(self.config['verify_endpoint'], data={'token': token})
......@@ -75,12 +80,6 @@ class JWTAuthProvider(AuthProvider):
self.ensure_user_exists(uid)
self.set_user_gravatar(uid, uid)
return {
'access_token': token,
'uid': uid,
'auth_type': self.auth_type,
'expires': datetime.datetime.utcnow() + datetime.timedelta(hours=1)
}
class GoogleOAuthProvider(AuthProvider):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment