-
|
The use case at hand is as follow, I want to:
I know how to do them individually, but not together/at the same time. Any help is appreciated |
Beta Was this translation helpful? Give feedback.
Answered by
jgould22
Jan 17, 2022
Replies: 1 comment 1 reply
-
|
You can probably do this with something like though I have not tested it raise HTTPException(status_code=302, detail="Not authorized", headers = {"Location": "your/login/route"} )Where the 302 tells the browser to redirect and the location header tells it where to redirect These links might also help https://fastapi.tiangolo.com/tutorial/handling-errors/#raise-an-httpexception-in-your-code https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
asaah18
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can probably do this with something like though I have not tested it
Where the 302 tells the browser to redirect and the location header tells it where to redirect
These links might also help
https://fastapi.tiangolo.com/tutorial/handling-errors/#raise-an-httpexception-in-your-code
https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections