Skip to content

Commit

Permalink
fix: corrected backeds nonce interface
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Feb 13, 2025
1 parent d60d968 commit b2d50a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions social_core/backends/discourse.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_user_details(self, response):
def add_nonce(self, nonce):
self.strategy.storage.nonce.use(self.setting("SERVER_URL"), time.time(), nonce)

def get(self, nonce):
def get_nonce(self, nonce):
return self.strategy.storage.nonce.get(self.setting("SERVER_URL"), nonce)

def delete_nonce(self, nonce):
Expand All @@ -79,7 +79,7 @@ def auth_complete(self, *args, **kwargs):

# Validate the nonce to ensure the request was not modified
response = parse_qs(decoded_params)
nonce_obj = self.get(response.get("nonce"))
nonce_obj = self.get_nonce(response.get("nonce"))
if nonce_obj:
self.delete_nonce(nonce_obj)
else:
Expand Down
4 changes: 2 additions & 2 deletions social_core/backends/open_id_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_and_store_nonce(self, url, state):
self.strategy.storage.association.store(url, association)
return nonce

def get(self, nonce):
def get_nonce(self, nonce):
try:
return self.strategy.storage.association.get(
server_url=self.authorization_url(), handle=nonce
Expand All @@ -166,7 +166,7 @@ def validate_claims(self, id_token):
if not nonce:
raise AuthTokenError(self, "Incorrect id_token: nonce")

nonce_obj = self.get(nonce)
nonce_obj = self.get_nonce(nonce)
if nonce_obj:
self.remove_nonce(nonce_obj.id)
else:
Expand Down

0 comments on commit b2d50a9

Please sign in to comment.