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

Authentication with Spring Security outdated #2880

Open
Silicat-git opened this issue Oct 30, 2024 · 1 comment
Open

Authentication with Spring Security outdated #2880

Silicat-git opened this issue Oct 30, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation hilla Issues related to Hilla

Comments

@Silicat-git
Copy link

The page for Authentication with SpringSecurity seems to be outdated, more specifically the Client-Side Security part
https://vaadin.com/docs/latest/hilla/guides/security/spring-login

The AuthProvider needs to be added to the root component in an index.tsx, however the new @index.tsx doesmt seem to be the right place as its the main page ("/").
Also it suggest to add stuff to the routes.tsx file which also doesnt exist in the current starter.

I've added the AuthProvider to the @layout.tsx instead now since its the only logical place, which works for the most part, but inside the Layout file itself I am unable to use the auth login/logout methods aswell as aquiring the state directly unless I wrap those code snippets into their own components and inserting them into the layout instead.
Trying to e.g. logout results in an error "Uncaught Error: AuthContext not initialized" otherwise

Not sure if this is how its supposed to work (assuming I didnt do it wrong) but it should be noted in the docs

@Silicat-git Silicat-git added documentation Improvements or additions to documentation hilla Issues related to Hilla labels Oct 30, 2024
@platosha
Copy link
Contributor

Thanks for reaching out. Let us update the Authentication article.

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 hilla Issues related to Hilla
Projects
None yet
Development

No branches or pull requests

2 participants