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 auth does not work with nuxt-content #144

Closed
alexbidenko opened this issue Apr 23, 2023 · 2 comments · Fixed by #145
Closed

Basic auth does not work with nuxt-content #144

alexbidenko opened this issue Apr 23, 2023 · 2 comments · Fixed by #145
Labels
bug Something isn't working

Comments

@alexbidenko
Copy link
Contributor

Version

nuxt-security: 0.13.0
nuxt: 3.4.2
@nuxt/content: 2.6.0

Description

If I want to use nuxt-security basicAuth with nuxt-content, I have been a problem that every page rendered by nuxt-content have not found error (not by http code, but on the page). I think the problem is the basicAuth middleware is applied on different pages (include /api/* routes). And when nuxt-content makes a request to its content (docs) it does not pass authorization. Because Authorization header does not pass through internal request. That's what I'm guessing.

Maybe it's worth disabling basicAuth for /api/* routes?

Reproduction Link

Repository with this issue - link.

Steps to reproduce

Just clone my repository and start it.

What is Expected?

Default nuxt-content page with Nuxt Content h1 (file is content/index.md).

What is actually happening?

Document with not found message on the page:

Document not found, overwrite this content with #not-found slot in <ContentDoc>.

@alexbidenko alexbidenko added the bug Something isn't working label Apr 23, 2023
@alexbidenko
Copy link
Contributor Author

alexbidenko commented Apr 24, 2023

May be something like this can help? #145

P.S. I've tested the solution in my project locally - and it have helped to solve the problem with nuxt-content :)

@Baroshem
Copy link
Owner

Hey @alexbidenko1998

Thank you so much for the issue and the PR to fix it. I am currently not able to work on this.

I will be back for maintaining this project in two weeks for now as I will be away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants