Dylz
Dylz
TTCTheo's Typesafe Cult
Created by Alefe Bispo - BRT on 7/20/2023 in #questions
What is the best strategy to deal with JWT in Nextjs?
If you’re using next auth there is tons of documentation on it. If you’re attempting to build your own auth… just remember there’s a reason it’s not something people do all the time
12 replies
TTCTheo's Typesafe Cult
Created by Alefe Bispo - BRT on 7/20/2023 in #questions
What is the best strategy to deal with JWT in Nextjs?
Db session
12 replies
TTCTheo's Typesafe Cult
Created by vgnxjhd on 7/20/2023 in #questions
what's adding the semicolons?
Set prettier to run on save. And if configured correctly it will remove all semicolons. If prettier is formatting on save but still has semicolons it’s probably some sort of configuration issue
7 replies
TTCTheo's Typesafe Cult
Created by Dylz on 7/14/2023 in #questions
How to make extracting components in typescript less cumbersome?
gotcha, thanks guys. I just wish there was a way I could highlight some jsx on my component and click a button and it would spit out a properly typed component based on what i extracted but sounds like that isn't possible
11 replies
TTCTheo's Typesafe Cult
Created by toadmilk on 7/9/2023 in #questions
how to make a custom styled UploadButton
please provide more info. What library is this using?
4 replies
TTCTheo's Typesafe Cult
Created by BigLung on 7/12/2023 in #questions
Custom protected routes?
althought for the middleware route, you would need the role to be in the session
30 replies
TTCTheo's Typesafe Cult
Created by BigLung on 7/12/2023 in #questions
Custom protected routes?
yeah i ended up just not including it in the session since it was such a pain, seemed like every time i thought i got it working there was another edge case that was broken
30 replies
TTCTheo's Typesafe Cult
Created by BigLung on 7/12/2023 in #questions
Custom protected routes?
in your root folder, 'src'. Make a middleware.ts and put something like this in it: export { default } from 'next-auth/middleware' export const config = { matcher: ['/TESTEST'] }
30 replies
TTCTheo's Typesafe Cult
Created by BigLung on 7/12/2023 in #questions
Custom protected routes?
@biglung not a bad idea to include the role in session, its possible, but a little bit tedious, i know someone posted a guide somewhere in here
30 replies
TTCTheo's Typesafe Cult
Created by BigLung on 7/12/2023 in #questions
Custom protected routes?
Checking client side is much slower, especially if you're using db sessions since it goes from server --> client --> server --> client
30 replies
TTCTheo's Typesafe Cult
Created by BigLung on 7/12/2023 in #questions
Custom protected routes?
I'd guess number 2, but ill defer to @nyx (Rustular DevRel)
30 replies
TTCTheo's Typesafe Cult
Created by Dylz on 7/1/2023 in #questions
How to access form data from before a user is authenticated?
@tcaputi how would I reference the partially completed data post login? I’d need some sort of identifier that can persist through the login.
7 replies
TTCTheo's Typesafe Cult
Created by Dylz on 7/1/2023 in #questions
How to access form data from before a user is authenticated?
Also just had the idea of passing an identifier through the redirect url. Thoughts?
7 replies
TTCTheo's Typesafe Cult
Created by Dylz on 6/30/2023 in #questions
How to redirect when user ~is~ authenticated
@nyx (Rustular DevRel) any idea how to do it through middleware? I can only seem to get it to require authentication and not the other way around
13 replies
TTCTheo's Typesafe Cult
Created by Dylz on 6/30/2023 in #questions
How to handle getSession delay on client components with NextAuth?
yeah i think this is expected behavior then
39 replies
TTCTheo's Typesafe Cult
Created by Dylz on 6/30/2023 in #questions
How to handle getSession delay on client components with NextAuth?
seems to always be loading state initially before it is authenticated, even when using JWT
39 replies
TTCTheo's Typesafe Cult
Created by Dylz on 6/30/2023 in #questions
How to handle getSession delay on client components with NextAuth?
39 replies
TTCTheo's Typesafe Cult
Created by Dylz on 6/30/2023 in #questions
How to handle getSession delay on client components with NextAuth?
Is this expected behavior? I can always just store user data in global state, but kinda defeats the purpose of the useSession hook
39 replies