Is your feature request related to a problem? Please describe.
When login into the application by OAuth you get redirected to the login page of the provider.
In case the user does not act within a small period of time (approx. 3 mins.) the login session gets invalid which currently causes a ugly response:
{"detail": "Unauthorized"}
Viewing a page containing the above JSON is not a good user experience and in case you are in an embedded browser without navigation controls (back/forward) you could get additional trouble on user side.
Describe the solution you'd like
Instead of raising a HTTPException use a RedirectResponse targeting the /login page.
The user will notice that something went wrong and will give another try.
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
When login into the application by OAuth you get redirected to the login page of the provider.
In case the user does not act within a small period of time (approx. 3 mins.) the login session gets invalid which currently causes a ugly response:
{"detail": "Unauthorized"}Viewing a page containing the above JSON is not a good user experience and in case you are in an embedded browser without navigation controls (back/forward) you could get additional trouble on user side.
Describe the solution you'd like
Instead of raising a
HTTPExceptionuse aRedirectResponsetargeting the/loginpage.The user will notice that something went wrong and will give another try.
Describe alternatives you've considered
N/A
Additional context
N/A