Skip to content

Commit b2d50a9

Browse files
committed
fix: corrected backeds nonce interface
1 parent d60d968 commit b2d50a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

social_core/backends/discourse.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_user_details(self, response):
5252
def add_nonce(self, nonce):
5353
self.strategy.storage.nonce.use(self.setting("SERVER_URL"), time.time(), nonce)
5454

55-
def get(self, nonce):
55+
def get_nonce(self, nonce):
5656
return self.strategy.storage.nonce.get(self.setting("SERVER_URL"), nonce)
5757

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

8080
# Validate the nonce to ensure the request was not modified
8181
response = parse_qs(decoded_params)
82-
nonce_obj = self.get(response.get("nonce"))
82+
nonce_obj = self.get_nonce(response.get("nonce"))
8383
if nonce_obj:
8484
self.delete_nonce(nonce_obj)
8585
else:

social_core/backends/open_id_connect.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def get_and_store_nonce(self, url, state):
139139
self.strategy.storage.association.store(url, association)
140140
return nonce
141141

142-
def get(self, nonce):
142+
def get_nonce(self, nonce):
143143
try:
144144
return self.strategy.storage.association.get(
145145
server_url=self.authorization_url(), handle=nonce
@@ -166,7 +166,7 @@ def validate_claims(self, id_token):
166166
if not nonce:
167167
raise AuthTokenError(self, "Incorrect id_token: nonce")
168168

169-
nonce_obj = self.get(nonce)
169+
nonce_obj = self.get_nonce(nonce)
170170
if nonce_obj:
171171
self.remove_nonce(nonce_obj.id)
172172
else:

0 commit comments

Comments
 (0)