whitenoise!
This commit is contained in:
@@ -16,7 +16,6 @@ from mozilla_django_oidc.contrib.drf import OIDCAuthentication
|
||||
class CustomOIDCBackend(OIDCAuthenticationBackend):
|
||||
def get_username(self, claims):
|
||||
if 'preferred_username' in claims and not User.objects.filter(username=claims['preferred_username']).exists():
|
||||
print(claims['preferred_username'])
|
||||
return claims['preferred_username']
|
||||
return super().get_username(claims)
|
||||
|
||||
@@ -32,7 +31,6 @@ class CustomOIDCBackend(OIDCAuthenticationBackend):
|
||||
def get_userinfo(self, access_token, id_token, payload):
|
||||
userinfo = cache.get(f'userinfo-{access_token}')
|
||||
if userinfo is None:
|
||||
print("no cache found for userinfo-{access_token} yet.")
|
||||
userinfo = super().get_userinfo(access_token, id_token, payload)
|
||||
if userinfo:
|
||||
cache.set(f'userinfo-{access_token}', userinfo, timeout=settings.OIDC_CACHE_USERINFO)
|
||||
|
||||
Reference in New Issue
Block a user