I'm curious if this is for version five, as I started to get this error: Type error: Route "app/api/auth/[...nextauth]/route.ts" does not match the required types of a Next.js Route. "authOptions" is not a valid Route export field.
This is still using NextAuth v4. However the problem is exporting the `authOptions` from your `route.js` file. To solve this error extract the `authOptions` object into a separate file.
do you know why am i getting this error Type '{ id: string; type: "email"; sendVerificationRequest({ identifier: email, url }: { identifier: any; url: any; }): Promise; }' is not assignable to type 'Provider'. Types of property 'type' are incompatible. Type '"email"' is not assignable to type '"oauth" | "credentials"'.
EmailProvider({ async sendVerificationRequest({ identifier: email, url }) { await sendVerificationRequest({ identifier: email, url }); }, }), This solved the type error for me
@@hamedbahram Actually passing that type is what pops the error, the type email doesnt exist, only OAuth or Credentials are available. the docs don't help aswell sounds outdated
NextAuth is a self hosted authentication service while Clerk is a hosted or managed service. While both are pretty straight forward to use, Clerk comes with prebuilt components you can drop in your app.
How do I use sever component inside other server component. i.e category, categoryProduct. I want to load one after other, also want to use Suspense to show loader. please tell me how can i do it.
Hi, I have top bar, menu, body and footer. All sections are in database, what will be best approach to call them using API? Hope you understand, please provide some reference regarding
Hello that you for this video this was very help. But can someone please tell me why email provider not working with smtp method in next 13. Tested it on next 12 working fine but with next 13 ive got an 500 server error with the default signin email. Anyone please do let me know if you encounter this issue.
I've had the email provider working in NextJs 13. You can clone my code and swap the custom provider with the built-in email provider and it should work. When calling the `signIn` method you need to pass the "email" as the provider Id like `signIn("email", {email})`
Hello ive clone your project still same error. I using Prisma client instead of mongo and install node mailer . Still cant use the default signin email. Internal 500 error
@@utech3657 Not sure where the error is from, I'd have to look at your implementation. From a high level, you need to use the `PrimsaAdapter` in your NextAuth config.
@@hamedbahram yes i have use prismaAdapter generate a database. I will go with next 12 as debuging this in next 13 is a headache. It should be simple but still dont know why i can post the default sigin email.
Thanks for the great video. How do we go about joining multiple accounts/providers on the same profile (i.e. similar to how it's done in reddit or epic games where I can sign in both from my Google and Apple accounts)
Dude, I love your approach/style. This was extremely helpful for me. Thank you!...from a happy new subscriber 🙂
Thanks for the sub, and welcome to the channel! I'm glad to hear that.
I'm curious if this is for version five, as I started to get this error:
Type error: Route "app/api/auth/[...nextauth]/route.ts" does not match the required types of a Next.js Route.
"authOptions" is not a valid Route export field.
This is still using NextAuth v4. However the problem is exporting the `authOptions` from your `route.js` file. To solve this error extract the `authOptions` object into a separate file.
What if we wanted to modify verification token method? Like I want it to be 6 number code and confirm it by inputting it in UI.
You can accomplish that by creating a custom flow using the credentials provider.
do you know why am i getting this error
Type '{ id: string; type: "email"; sendVerificationRequest({ identifier: email, url }: { identifier: any; url: any; }): Promise; }' is not assignable to type 'Provider'.
Types of property 'type' are incompatible.
Type '"email"' is not assignable to type '"oauth" | "credentials"'.
Pass the `NextAuthOptions` type from `next-auth` to your authOptions type. See more here → authjs.dev/guides/providers/email-http
EmailProvider({
async sendVerificationRequest({ identifier: email, url }) {
await sendVerificationRequest({ identifier: email, url });
},
}),
This solved the type error for me
@@hamedbahram Actually passing that type is what pops the error, the type email doesnt exist, only OAuth or Credentials are available. the docs don't help aswell sounds outdated
I am following all your videos , it’s very informative ❤️. Can you also make one video about micro front ends with next 13
Glad to hear that! I'll keep that in mind for future videos.
Can you explain to me please - do nextAuth and Clerk do the same job? What is better?
NextAuth is a self hosted authentication service while Clerk is a hosted or managed service. While both are pretty straight forward to use, Clerk comes with prebuilt components you can drop in your app.
How do I use sever component inside other server component. i.e category, categoryProduct. I want to load one after other, also want to use Suspense to show loader. please tell me how can i do it.
Just like any other component in React you can compose server components.
Hi, I have top bar, menu, body and footer. All sections are in database, what will be best approach to call them using API? Hope you understand, please provide some reference regarding
You can use server components in the App router and fetch data directly inside your component.
Very helpful, thank you!!!
Glad it was helpful!
Hello that you for this video this was very help. But can someone please tell me why email provider not working with smtp method in next 13. Tested it on next 12 working fine but with next 13 ive got an 500 server error with the default signin email. Anyone please do let me know if you encounter this issue.
I've had the email provider working in NextJs 13. You can clone my code and swap the custom provider with the built-in email provider and it should work. When calling the `signIn` method you need to pass the "email" as the provider Id like `signIn("email", {email})`
@@hamedbahram ok will try and let you know thank you
Hello ive clone your project still same error. I using Prisma client instead of mongo and install node mailer . Still cant use the default signin email. Internal 500 error
@@utech3657 Not sure where the error is from, I'd have to look at your implementation. From a high level, you need to use the `PrimsaAdapter` in your NextAuth config.
@@hamedbahram yes i have use prismaAdapter generate a database. I will go with next 12 as debuging this in next 13 is a headache. It should be simple but still dont know why i can post the default sigin email.
As far as i know there is no simple way to change user's email after sign up. Maybe I'm wrong about that?
It is possible to update the user record and change the email if using the email/credentials provider. Though it won't work if using social logins.
Thanks for the great video. How do we go about joining multiple accounts/providers on the same profile (i.e. similar to how it's done in reddit or epic games where I can sign in both from my Google and Apple accounts)
Good question 🤔 I'd have to test this, not sure if next-auth automatically links accounts if using the same email on both accounts.
Anyone having issues on implementing email provider with vercel? I have to submit twice on production
Nice thanks so much❤
My pleasure!
Thanks
Anytime!
❤
Thanks!
hitesh duplicate
I'm not familiar with the creator you mentioned but I'm sure there are similar videos about custom sign in emails in nextauth.