Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: When NextAuth authentication provider is selected, the Next Steps section need to indicate setting up Discord client info in .env file #1812

Open
coombsj opened this issue Mar 27, 2024 · 3 comments

Comments

@coombsj
Copy link

coombsj commented Mar 27, 2024

Provide environment information

System:
OS: macOS 11.7.10
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 148.06 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 21.7.1 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 10.5.0 - /usr/local/bin/npm
pnpm: 8.15.5 - ~/Library/pnpm/pnpm

"ct3aMetadata": {
"initVersion": "7.30.0"
}

Describe the bug

npm run dev

test-app@0.1.0 dev
next dev

❌ Invalid environment variables: {
DISCORD_CLIENT_ID: [ 'Required' ],
DISCORD_CLIENT_SECRET: [ 'Required' ]
}

Node.js v21.7.1

Reproduction repo

Part of setting up the project nothing to deploy yet.

To reproduce

Ran npm create t3-app@latest to create new app with the following selections:


◇ What will your project be called?
│ test-app

◇ Will you be using TypeScript or JavaScript?
│ TypeScript

◇ Will you be using Tailwind CSS for styling?
│ Yes

◇ Would you like to use tRPC?
│ Yes

◇ What authentication provider would you like to use?
│ NextAuth.js

◇ What database ORM would you like to use?
│ Prisma

◇ EXPERIMENTAL Would you like to use Next.js App Router?
│ Yes

◇ What database provider would you like to use?
│ SQLite

◇ Should we initialize a Git repository and stage the changes?
│ Yes

◇ Should we run 'npm install' for you?
│ Yes

◇ What import alias would you like to use?
│ ~/

Using: npm

Followed next steps provided:
cd test-app
npm run db:push
npm run dev

Additional information

Suggestion to enhance next steps section to include something about setting environment variables when using NextAuth.

@sahilrajput03
Copy link

sahilrajput03 commented Apr 1, 2024

I fixed this issue by simply updating discord environment variables like shown below in .env file:

DISCORD_CLIENT_ID="sample"
DISCORD_CLIENT_SECRET="sample"

@sahilrajput03
Copy link

Also, you can fix it via making discord env values optional in env.js file:

    DISCORD_CLIENT_ID: z.string().optional(),
    DISCORD_CLIENT_SECRET: z.string().optional(),

@kakeWasTaken
Copy link
Contributor

kakeWasTaken commented Apr 10, 2024

I believe there is a section in the "First Steps" part of create-t3-app's documentation that addresses this issue.
Look under "Authentication": https://create.t3.gg/en/usage/first-steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants