Commit ffc80b87 authored by Linus Lewandowski's avatar Linus Lewandowski

Fix account-settings endpoint.

parent f408a465
Pipeline #14145528 canceled with stages
......@@ -7,6 +7,8 @@ from jose import jwt
from .models import RSAKey
JWTError = jwt.JWTError
def encode(myself, audience, payload, expires_in):
now = int(time())
......@@ -41,10 +43,10 @@ def decode(myself, issuers, payload):
verify_aud = myself is not None,
),
)
except jwt.JWTError as e:
except JWTError as e:
try:
e.payload = jwt.get_unverified_claims(payload)
except jwt.JWTError:
except JWTError:
pass
raise
......
......@@ -24,11 +24,9 @@ class AccountSettingsView(View):
id_token_hint = id_token_hint,
))
for acc in request.user.accounts:
if req.id_hint['sub'] == str(acc.pk):
return redirect('extauth:settings', user_id=str(acc.pk))
if request.user.is_authenticated:
for acc in request.user.accounts:
if req.id_hint['sub'] == str(acc.pk):
return redirect('extauth:account-home', account_id=str(acc.pk))
if request.user.is_authenticated:
return redirect('extauth:settings', user_id=str(request.user.pk))
return redirect(settings.LOGIN_REDIRECT_URL)
return redirect('extauth:select-account')
......@@ -44,6 +44,8 @@ class InputDict: # We're treating all missing params as params with no value
class OAuthRequest:
redirect_uri_param = None
@classmethod
def parse(kind, data):
oauth_req = InputDict(data)
......
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