Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/magiclink_cross_device_sample_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def verify():
token = input("Please insert the token you received by email:\n")
try:
descope_client.magiclink.verify(token=token)
logging.info("Code is valid")
logging.info("Token is valid")
except AuthException as e:
logging.info(f"Invalid code {e}")
logging.info(f"Invalid Token {e}")
raise

logging.info("Going to signup / signin using Magic Link ...")
Expand Down
10 changes: 5 additions & 5 deletions samples/magiclink_sample_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def main():
token = input("Please insert the token you received by email:\n")
try:
jwt_response = descope_client.magiclink.verify(token=token)
logging.info("Code is valid")
logging.info("Token is valid")
refresh_token = jwt_response.get(REFRESH_SESSION_TOKEN_NAME).get("jwt")
logging.info(f"jwt_response: {jwt_response}")
except AuthException as e:
logging.info(f"Invalid code {e}")
logging.info(f"Invalid Token {e}")
raise

try:
Expand All @@ -51,15 +51,15 @@ def main():
method=DeliveryMethod.EMAIL, identifier=email, uri="http://test.me"
)

token = input("Please insert the code you received by email:\n")
token = input("Please insert the Token you received by email:\n")
try:
jwt_response = descope_client.magiclink.verify(token=token)
logging.info("Code is valid")
logging.info("Token is valid")
session_token_1 = jwt_response.get(SESSION_TOKEN_NAME).get("jwt")
refresh_token_1 = jwt_response.get(REFRESH_SESSION_TOKEN_NAME).get("jwt")
logging.info(f"jwt_response: {jwt_response}")
except AuthException as e:
logging.info(f"Invalid code {e}")
logging.info(f"Invalid Token {e}")
raise

try:
Expand Down
6 changes: 3 additions & 3 deletions samples/magiclink_web_sample_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ def sign_up_or_in():
@APP.route("/api/verify", methods=["POST"])
def verify():
data = request.get_json(force=True)
code = data.get("code", None)
if not code:
token = data.get("token", None)
if not token:
return Response("Unauthorized", 401)

try:
jwt_response = descope_client.magiclink.verify(DeliveryMethod.EMAIL, code)
jwt_response = descope_client.magiclink.verify(token)
except AuthException:
return Response("Unauthorized", 401)

Expand Down