#Type error in Next Auth provider
15 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
thats my types file
Your environment variables could be undefined, so TypeScript is complaining.
Change:
process.env.DISCORD_ CLIENT_IDtoprocess.env.DISCORD_ CLIENT_ID as stringprocess.env.DISCORD_CLIENT_SECRETtoprocess.env.DISCORD_CLIENT_SECRET as string
Also check out: https://env.t3.gg/docs/nextjs
thanks
and for the callbackurl?
Argument of type '{ clientId: string; clientSecret: string; callbackUrl: string | undefined; token: string; userinfo: string; authorization: { params: { scope: string; }; }; }' is not assignable to parameter of type 'OAuthUserConfig<any>'.
Object literal may only specify known properties, and 'callbackUrl' does not exist in type 'OAuthUserConfig<any>'.ts(2345)
you can also just add ! to the end
process.env.DISCORD_CLIENT_ID!
process.env.DISCORD_CLIENT_SECRET! process.env.DISCORD_CLIENT_SECRET!
but do the same thing that you did for the other 2 for this one
i've tried but i still get the same error:
Type error: Argument of type '{ clientId: string; clientSecret: string; callbackUrl: string; token: string; userinfo: string; authorization: { params: { scope: string; }; }; }' is not assignable to parameter of type 'OAuthUserConfig<any>'.
Object literal may only specify known properties, and 'callbackUrl' does not exist in type 'OAuthUserConfig<any>'.
ahh callbackurl isn't an option...
oh lol, sorry
yeah because the callback is done automatically by nextauth
and have you added the callback of the folowing to your discord redirects section for the app:
http://localhost:3000/api/auth/callback/discord (and change the domain for your actual domains too)
This question has been marked as answered! If you have any other questions, feel free to create another post
[Click here](#1153637183673081896 message)