Skip to content

Commit 8071053

Browse files
committed
Merge branch 'feat/httpx' into feat/async-methods
2 parents a74ef35 + 7818934 commit 8071053

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

descope/authmethod/enchantedlink.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from __future__ import annotations
22

3-
import httpx
4-
from typing import Awaitable, Union
3+
from typing import Awaitable, Union, TYPE_CHECKING
4+
5+
if TYPE_CHECKING:
6+
import httpx
57

68
from descope._auth_base import AuthBase
79
from descope.auth import Auth

samples/magiclink_web_sample_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask, Response, g, jsonify, request
1+
from flask import Flask, Response, _request_ctx_stack, jsonify, request
22

33
from descope import (
44
COOKIE_DATA_NAME,
@@ -116,7 +116,7 @@ def verify():
116116
@APP.route("/api/verify_by_decorator", methods=["GET"])
117117
@descope_verify_magiclink_token(descope_client)
118118
def verify_by_decorator(*args, **kwargs):
119-
claims = g.top.claims
119+
claims = _request_ctx_stack.top.claims
120120
response = f"This is a code verification API, claims are: {claims}"
121121
return jsonify(message=response)
122122

0 commit comments

Comments
 (0)