A social pastebin built on atproto.
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

handle exception in oauth_callback

+11 -7
+11 -7
main.py
··· 532 532 return redirect(url_for("index")) 533 533 534 534 client_id, redirect_uri = compute_client_id(request.url_root) 535 - tokens, dpop_authserver_nonce = initial_token_request( 536 - row, 537 - code, 538 - client_id, 539 - redirect_uri, 540 - CLIENT_SECRET_JWK, 541 - ) 535 + try: 536 + tokens, dpop_authserver_nonce = initial_token_request( 537 + row, 538 + code, 539 + client_id, 540 + redirect_uri, 541 + CLIENT_SECRET_JWK, 542 + ) 543 + except Exception: 544 + flash("Login failed — could not complete token exchange. Try again.", "error") 545 + return redirect(url_for("index")) 542 546 543 547 if row["did"]: # type: ignore[index] 544 548 did, handle, pds_url = row["did"], row["handle"], row["pds_url"] # type: ignore[index]