Skip to content

Commit ab81167

Browse files
authored
Discard changes to descope/flask/__init__.py
1 parent 7d53b18 commit ab81167

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

descope/flask/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import uuid
55
from functools import wraps
66

7-
from flask import Response, g, redirect, request
7+
from flask import Response, _request_ctx_stack, redirect, request
88

99
from .. import (
1010
COOKIE_DATA_NAME,
@@ -143,7 +143,7 @@ def decorated(*args, **kwargs):
143143
return Response("Access denied", 401)
144144

145145
# Save the claims on the context execute the original API
146-
g.claims = jwt_response
146+
_request_ctx_stack.top.claims = jwt_response
147147
response = f(*args, **kwargs)
148148

149149
if jwt_response.get(COOKIE_DATA_NAME, None):
@@ -181,7 +181,7 @@ def decorated(*args, **kwargs):
181181
return Response("Unauthorized", 401)
182182

183183
# Save the claims on the context execute the original API
184-
g.claims = jwt_response
184+
_request_ctx_stack.top.claims = jwt_response
185185
response = f(*args, **kwargs)
186186

187187
set_cookie_on_response(
@@ -224,7 +224,7 @@ def decorated(*args, **kwargs):
224224
return Response("Unauthorized", 401)
225225

226226
# Save the claims on the context execute the original API
227-
g.claims = jwt_response
227+
_request_ctx_stack.top.claims = jwt_response
228228
response = f(*args, **kwargs)
229229

230230
set_cookie_on_response(
@@ -267,7 +267,7 @@ def decorated(*args, **kwargs):
267267
return Response("Unauthorized", 401)
268268

269269
# Save the claims on the context execute the original API
270-
g.claims = jwt_response
270+
_request_ctx_stack.top.claims = jwt_response
271271
response = f(*args, **kwargs)
272272

273273
set_cookie_on_response(
@@ -310,7 +310,7 @@ def decorated(*args, **kwargs):
310310
return Response("Unauthorized", 401)
311311

312312
# Save the claims on the context execute the original API
313-
g.claims = jwt_response
313+
_request_ctx_stack.top.claims = jwt_response
314314
response = f(*args, **kwargs)
315315

316316
set_cookie_on_response(
@@ -400,7 +400,7 @@ def decorated(*args, **kwargs):
400400
return Response("Unauthorized", 401)
401401

402402
# Save the claims on the context execute the original API
403-
g.claims = jwt_response
403+
_request_ctx_stack.top.claims = jwt_response
404404
response = f(*args, **kwargs)
405405

406406
set_cookie_on_response(

0 commit comments

Comments
 (0)