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

Basic http auth #1126

Closed
shyamchandranmec opened this issue Jul 20, 2017 · 5 comments
Closed

Basic http auth #1126

shyamchandranmec opened this issue Jul 20, 2017 · 5 comments
Labels

Comments

@shyamchandranmec
Copy link

shyamchandranmec commented Jul 20, 2017

Hi,
I would like to add basic http authentication to a subset of routes.
For eg: /app/* should have basic http authentication.
I couldn't find an example.
Pls help

This question is available on Nuxt.js community (#c988)
@pi0
Copy link
Member

pi0 commented Jul 20, 2017

Hi. Which version are you currently using? Also would please provide more details about use case?
I mean how should auth useful without protecting API itself?

@shyamchandranmec
Copy link
Author

shyamchandranmec commented Jul 20, 2017

@pi0 version 1.0.0 alpha.3 . I have another app using version 0.10.5.
These are just protected pages which will be accessible to only few people. Api interactions are very rare in such pages.

This will help us to create protected pages quickly without setting up session/token based authentication.

@pi0
Copy link
Member

pi0 commented Jul 20, 2017

I've provided a minimal example for basic auth using nuxt 1.x serverMiddleware feature:
https://glitch.com/edit/#!/nuxt-basic-auth?path=auth.js:13:8
https://nuxt-basic-auth.glitch.me/about

But consider that this is not enough. Client side routes should be protected too using middleware. (For example when navigate from / => /about)

PS I've closed this as a more general auth solution is coming after stable 1 release :)

@pi0 pi0 closed this as completed Jul 20, 2017
@shyamchandranmec
Copy link
Author

@pi0 Thanks for the example.

@lock
Copy link

lock bot commented Nov 3, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 3, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants