Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intercept global 401 (Unauthorized) #25

Open
cvalues opened this issue May 30, 2023 · 2 comments
Open

Intercept global 401 (Unauthorized) #25

cvalues opened this issue May 30, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@cvalues
Copy link

cvalues commented May 30, 2023

Hi,

how to intercept all 401 global, to redirect them to the login page?
Is it possible to capture all 401s in a plugin and direct them to the login page?
And if so, how ;) ?

thx alot!

@kreejzak
Copy link
Collaborator

Hi @cvalues, as of right now this is unfortunately not possible.
All guarded pages must have auth middleware. Tho, you should be able to use nuxt nested pages.

I'm in the middle of a major rewrite that will introduce new features with global middleware among them.
Stay tuned, unfortunately no firm timeframe, but soon (tm).

@kreejzak kreejzak added this to the 1.0 milestone May 30, 2023
@kreejzak kreejzak added the enhancement New feature or request label May 30, 2023
@cvalues
Copy link
Author

cvalues commented May 31, 2023

Hi @kreejzak,

thanks for your repley and thanks for your good work.
I stay tuned..

The problem does not exist with the page reload, everything works there. But if you are on the same page and the session has expired, the api throws errors and you cannot react to them.

KR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants