A social pastebin built on atproto.
6
fork

Configure Feed

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

handle slow PDS auth timeouts

+14 -10
+14 -10
main.py
··· 453 453 dpop_private_jwk = JsonWebKey.generate_key("EC", "P-256", is_private=True) 454 454 client_id, redirect_uri = compute_client_id(request.url_root) 455 455 456 - pkce_verifier, state, dpop_authserver_nonce, resp = send_par_auth_request( 457 - authserver_url, 458 - authserver_meta, 459 - username, 460 - client_id, 461 - redirect_uri, 462 - OAUTH_SCOPE, 463 - CLIENT_SECRET_JWK, 464 - dpop_private_jwk, 465 - ) 456 + try: 457 + pkce_verifier, state, dpop_authserver_nonce, resp = send_par_auth_request( 458 + authserver_url, 459 + authserver_meta, 460 + username, 461 + client_id, 462 + redirect_uri, 463 + OAUTH_SCOPE, 464 + CLIENT_SECRET_JWK, 465 + dpop_private_jwk, 466 + ) 467 + except Exception: 468 + flash("Login request timed out. Try again.", "error") 469 + return redirect(url_for("index")) 466 470 467 471 if resp.status_code != 201: 468 472 flash("Login request failed. Try again later.", "error")