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

Introducing AuthMiddleware in the authentication example #1557

Merged
merged 5 commits into from
Sep 18, 2023

Conversation

rodja
Copy link
Member

@rodja rodja commented Sep 5, 2023

As mentioned in #1555 it would be good to have the auth-checks in one place. This pull request shows the usage of a custom middleware to check if access to a page is allowed. To demonstrate the back-routing after login it also adds another subpage.

and add another subpage for demonstration
@rodja rodja added the documentation Improvements or additions to documentation label Sep 5, 2023
@rodja rodja added this to the 1.3.14 milestone Sep 5, 2023
@rodja rodja requested a review from falkoschindler September 5, 2023 04:20
Copy link
Contributor

@falkoschindler falkoschindler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run the example, the page doesn't load. I see "Connection lost. Trying to reconnect..." and the JavaScript console says:

Uncaught SyntaxError: Unexpected token '<' es-module-shims.js:1
Uncaught SyntaxError: Unexpected token '<' socket.io.min.js:1
Uncaught SyntaxError: Unexpected token '<' tailwindcss.min.js:1
Uncaught SyntaxError: Unexpected token '<' vue.global.prod.js:1
Uncaught SyntaxError: Unexpected token '<' quasar.umd.prod.js:1
Uncaught SyntaxError: Unexpected token '<' en-US.umd.prod.js:1
Failed to load module script: Expected a JavaScript module script but
the server responded with a MIME type of "text/html". Strict MIME type
checking is enforced for module scripts per HTML spec.
:8080/login?referer_path=/_nicegui/0.1.0/components/b0b17893a51343979e2090deee730538/input.js:1

@rodja
Copy link
Member Author

rodja commented Sep 17, 2023

@falkoschindler I've fixed the issue.

@falkoschindler falkoschindler merged commit 5662357 into main Sep 18, 2023
2 of 4 checks passed
@falkoschindler falkoschindler deleted the auth-middleware branch September 18, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants