Skip to content

CORS Error When Attempting Cross-Origin Authentication with FastAPI Integration #487

Answered by frankie567
Pediatra asked this question in Q&A
Discussion options

You must be logged in to vote

The authorize page is not designed to be fetched by JavaScript: you should redirect the user to this page.

Actually, even if you don't serve HTML through FastAPI, the process is the same: the backend will set the cookie and redirect the user to a page. You can very well redirect to your frontend app at this stage.

Another approach is to let the frontend app get the token and pass it manually to the backend, as explained in the browser example: https://docs.fief.dev/integrate/javascript/frontend/browser/

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Pediatra
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