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
Issue with auth.ts #23
Comments
Well aware there are a few issues with the auth and how cookies are stored. Will have a look at this when I get a bit of time 👍 |
Hey! The auth.ts is totally fine :) All that was needed was to import onmounted from vue and than use onmounted to call the user data. |
Hi @BlackDahlia313 I tried your pull-request locally, but unfortunately this didn't seem to fix the issue. I am still getting the error and keep signing out. |
Good to know! I was looking around and it seems onmounted might be the way
Im assuming you mean for the protected pages using the middleware. That needs an update as well. The patch is only for the auth component. and works when refreshing the homepage to keep you logged in. The middleware itself needs some love. |
@M-GRV How did you fix that? What did you adjust in the middleware/auth.js? Thanks |
Exactly how I did it in my PR. But I am moving onto using a Module now. |
Or maybe we can fix this using the new SDK? |
I'll probably end up refactoring the Directus plugin and the auth based on the new SDK once released. |
thats what we are doing for our site. This starter kit was a good reference to learn from. ;) |
Glad to hear it. If you haven't seen it already - there's this Nuxt project we rolled out last week as well to use as reference / inspiration. Haven't got a ton of documentation on it yet and will be doing some content around it soon – but it does have a lot of more advanced / interesting bits in there like dynamic forms / dynamic og images / etc. |
Really happy to see some new Nuxt examples being developed :) Looking at the code, is the recommended approach now to use a module for auth? |
I have created a pretty large app with this boilerplate, so really happy with that. Only issue for me is the authentication each time I refresh. But will keep an eye out for upcoming changes and the new SDK. |
👍
Going to be a bit before I've got time to dig back into this starter, but you might have a look at this module for Nuxt that another community member - @becem-gharbi put together. |
Highly recommend this module even tho I decided to build from the SDK directly. The dev is very responsive. |
Hi,
I am facing an issue with the authentication.
When signing in, everything goes fine, but then I later on I get the error:
TypeError: Cannot read properties of undefined (reading 'users')
Seems like it's coming form the function:
Also, when reloading a page I will have to sign-in again.
This might have to do with the same error?
Hope anyone knows a fix for this.
The text was updated successfully, but these errors were encountered: