Skip to content

OAuth failure should redirect to login page #2822

@mm-kpk

Description

@mm-kpk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    authPertaining to authentication.needs-triagestaleIssue has not had recent activity or appears to be solved. Stale issues will be automatically closed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions