Github Oauth not triggering

just created a new t3 app and removed discord oauth provider and added github oauth provider. Then i tried running npm run build and i got this error - info Loaded env from /home/susant/t3-ecommerce/.env āŒ Invalid environment variables: { DISCORD_CLIENT_ID: [ 'Required' ], DISCORD_CLIENT_SECRET: [ 'Required' ] } What am i doing wrong
Solution:
ahh. then you should remove the DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET from env.mjs. both from the server and runtimeEnv property
Jump to solution
7 Replies
Sturlen
Sturlenā€¢16mo ago
did you add your Discord credentials to your .env file?
susant
susantOPā€¢16mo ago
no [...nextauth].ts import NextAuth from "next-auth" import GithubProvider from "next-auth/providers/github" export default NextAuth({ providers: [ GithubProvider({ clientId: process.env.GITHUB_ID ?? '', clientSecret: process.env.GITHUB_SECRET ?? '', }), ], }) my env file DATABASE_URL='mysql://3qf8xyfkkrlimrykcgqt:pscale_pw_tpKk5kTHPhm4LR5OU5PjsPb7SHtN7HyxfokYp26kA@aws.connect.psdb.cloud/ecommerce?sslaccept=strict' NEXTAUTH_SECRET="BFNRBPzezKBBC9rxcB/3/Mhc/ZAbwGvEJkvW+Z3Nk=" Github Provider GITHUB_ID="1385d6c1396b997099b" GITHUB_SECRET="20738ff3267afa5460c4c0749e01c3d234ec89a"
Solution
Sturlen
Sturlenā€¢16mo ago
ahh. then you should remove the DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET from env.mjs. both from the server and runtimeEnv property
Sturlen
Sturlenā€¢16mo ago
please don't post your secrets publicly, this can be used to impersonate your service
susant
susantOPā€¢16mo ago
i have edited them šŸ˜‚ and i have to replace them with github creds right
Sturlen
Sturlenā€¢16mo ago
yes
susant
susantOPā€¢16mo ago
Thank you
Want results from more Discord servers?
Add your server