From 0c55a19cbcb0e3be7f439fe09df8b5c4de9f2e5a Mon Sep 17 00:00:00 2001
From: frankie567
You should either set route_name
, which will automatically reverse the URL, or redirect_url
, which is an arbitrary URL you set.
from fastapi import FastAPI, Depends
-from httpx_oauth.integrations.fastapi import OAuth2AuthorizeCallback
-from httpx_oauth.oauth2 import OAuth2
-
-client = OAuth2("CLIENT_ID", "CLIENT_SECRET", "AUTHORIZE_ENDPOINT", "ACCESS_TOKEN_ENDPOINT")
-oauth2_authorize_callback = OAuth2AuthorizeCallback(client, "oauth-callback")
-app = FastAPI()
-
-@app.get("/oauth-callback", name="oauth-callback")
-async def oauth_callback(access_token_state=Depends(oauth2_authorize_callback)):
- token, state = access_token_state
- # Do something useful
+from fastapi import FastAPI, Depends
+from httpx_oauth.integrations.fastapi import OAuth2AuthorizeCallback
+from httpx_oauth.oauth2 import OAuth2
+
+client = OAuth2("CLIENT_ID", "CLIENT_SECRET", "AUTHORIZE_ENDPOINT", "ACCESS_TOKEN_ENDPOINT")
+oauth2_authorize_callback = OAuth2AuthorizeCallback(client, "oauth-callback")
+app = FastAPI()
+
+@app.get("/oauth-callback", name="oauth-callback")
+async def oauth_callback(access_token_state=Depends(oauth2_authorize_callback)):
+ token, state = access_token_state
+ # Do something useful
@@ -538,7 +644,7 @@ OAuth2AuthorizeCallback
{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}
+
diff --git a/index.html b/index.html
index 0671fca..5a4e741 100644
--- a/index.html
+++ b/index.html
@@ -12,7 +12,7 @@
-
+
@@ -46,6 +46,10 @@
+
+
+
+
@@ -58,10 +62,12 @@
+
+
-
+
@@ -114,8 +120,44 @@