Skip to content

Google Oauth success redirect with React app #1366

Discussion options

You must be logged in to vote

Thanks, @hgalytoby for suggestion.

So here I will publish full React frontend solution for all, who will have such question in future :)
Here is full boilerplate implementation of fastapi-users + beanie + oauth + react:
https://github.com/philipshurpik/fastapi-oauth-mongo-react-starter

And here is simple part what we need to implement additionally to this docs:
https://fastapi-users.github.io/fastapi-users/latest/configuration/oauth/#beanie

  1. Let's have React route:
    <Route path="/oauth-callback" element={<OAuthCallback />} />
  2. Add backend OAuth router:
redirect_url = f"{settings.FRONTEND_URL}/oauth-callback"
app.include_router(
    fastapi_users.get_oauth_router(
        google_oauth_clie…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@philipshurpik
Comment options

Comment options

You must be logged in to vote
1 reply
@hgalytoby
Comment options

Answer selected by philipshurpik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants