roga
Interesting problem with my audit trail...
In an app I built, I'm using the Supabase Nuxt module to get user metadata or email address and I'm using it to create an audit trail when I create an entity in my database.
The problem is that sometimes it was returning someone elses information entirely. I observed the bug first-hand and I couldn't really explain what was happening.
For some API routes, I was using a useAuth.ts function I created in my server-side utils folder that looked like this.
I'm deploying to Vercel and I was curious if the util was somehow being reused by different users, capturing the wrong user details and retaining it. I don't understand how, but I'm very perplexed as to how the wrong user information is consistently inserting itself into my audit trail...
Any ideas?
1 replies
Pop-up Components
If I wanted to build a reusable component that acts as a modal and overlays anything going on beneath it, how would I do it? Specifically, how do I ensure everything "beneath" it has the proper z index, relevant to my modal component?
And what is it called when you develop a specific use case component and make it available for others to add to their projects? Is this a plugin?
I've only ever built my own projects. Never worked on something that someone else might some day use. Any advice would be super helpful. Thank you in advance - you're awesome.
2 replies
NuxtLinks just stop working
I'm wondering if anyone has had the problem where you get one and only one click out of your nuxt links and then everything just stops working. If so, how did you fix this? I've restarted the server several times but the router just seems to quit with absolutely no error logging in the client or on the server. Help?!
13 replies
Nuxt & Supabase Auth
I've set up working authentication in my Nuxt 3 app. I have an authGuard middleware that I've set up which is super basic:
The thing is, I'm redirecting from '/login' to '/dashboard' but if I auth guard the dashboard, it immediately sends the user back to '/login' because the very first instant when the script runs, there is still no user registered.
How can I make sure that I wait until the Supabase does it's thing, registers that there is a suer, before checking for a user and redirecting if none is found?
7 replies
How do I export TypeScript Types for use elsewhere in Nuxt
I'd like to be able to auto-import types I declare somewhere (anywhere) and use them anywhere in my Nuxt app. Kind of like I do with components. Is there a way to throw them into a
types
folder and import them with ~/types
? Or better yet, have them auto import?
I'm still new to TypeScript. It wasn't something I was taught in school. Just picking up what I can as I go, so if I'm ignoring something super basic that I should know about typescript in Nuxt, that's probably why.5 replies