mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 15:32:14 +00:00
Fixed penguins of death due to infinite loop of SSO login redirects
This commit is contained in:
@@ -73,8 +73,11 @@ class DiscourseAuth(BaseAuth):
|
||||
def auth_complete(self, *args, **kwargs):
|
||||
"""Completes login process, must return user instance."""
|
||||
|
||||
if not self.sso.validate(self.data['sso'], self.data['sig']):
|
||||
raise Exception("Someone wants to hack us!")
|
||||
try:
|
||||
if not self.sso.validate(self.data['sso'], self.data['sig']):
|
||||
raise Exception("Someone wants to hack us!")
|
||||
except KeyError:
|
||||
raise Exception("SSO Error, please try again")
|
||||
|
||||
nonce = self.sso.get_nonce(self.data['sso'])
|
||||
nonce_obj = self.get_nonce(nonce)
|
||||
|
||||
@@ -15,7 +15,7 @@ class DiscourseSSO:
|
||||
payload.encode(),
|
||||
sha256
|
||||
).hexdigest()
|
||||
print(type(computed_sig), type(sig))
|
||||
|
||||
return hmac.compare_digest(unicode(computed_sig), sig)
|
||||
|
||||
def get_nonce(self, payload):
|
||||
|
||||
Reference in New Issue
Block a user