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:Jump to solution
ahh. then you should remove the
DISCORD_CLIENT_ID
and DISCORD_CLIENT_SECRET
from env.mjs
. both from the server and runtimeEnv property7 Replies
did you add your Discord credentials to your .env file?
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
ahh. then you should remove the
DISCORD_CLIENT_ID
and DISCORD_CLIENT_SECRET
from env.mjs
. both from the server and runtimeEnv propertyplease don't post your secrets publicly, this can be used to impersonate your service
i have edited them š
and i have to replace them with github creds right
yes
Thank you