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

Add NEXTAUTH_URL_INTERNAL option #757

Merged
merged 6 commits into from Sep 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ DATABASE_URL="postgresql://john:doe@localhost:5432/master-bot?schema=public"
DISCORD_TOKEN=""

NEXTAUTH_SECRET="somesupersecrettwelvelengthword"
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_URL=
NEXTAUTH_URL_INTERNAL=http://localhost:3000
NEXT_PUBLIC_INVITE_URL="https://discord.com/api/oauth2/authorize?client_id=yourclientid&permissions=8&scope=bot"

# Next Auth Discord Provider
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ DISCORD_TOKEN=""
# Next Auth

NEXTAUTH_SECRET="somesupersecrettwelvelengthword"
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_URL=http://domian:3000
NEXTAUTH_URL_INTERNAL=http://localhost:3000
NEXT_PUBLIC_INVITE_URL="https://discord.com/api/oauth2/authorize?client_id=yourclientid&permissions=8&scope=bot"

# Next Auth Discord Provider
Expand Down Expand Up @@ -98,10 +99,15 @@ Change 'john' to your pc username and 'doe' to some password, or set the name an
Generate a token in your Discord developer portal.

#### Next Auth
You can leave everything as is, just change 'yourclientid' in NEXT_PUBLIC_INVITE_URL to your Discord bot id.
You can leave everything as is, just change 'yourclientid' in NEXT_PUBLIC_INVITE_URL to your Discord bot id and then change 'domain' in NEXTAUTH_URL to your domain or public ip. You can find your public ip by going to [www.whatismyip.com](https://www.whatismyip.com/).

#### Next Auth Discord Provider
Go to the OAuth2 tab in the developer portal, copy the Client ID to DISCORD_CLIENT_ID and generate a secret to place in DISCORD_CLIENT_SECRET. Also, set this as the URL under 'Redirects': http://localhost:3000/api/auth/callback/discord.
Go to the OAuth2 tab in the developer portal, copy the Client ID to DISCORD_CLIENT_ID and generate a secret to place in DISCORD_CLIENT_SECRET. Also, set the following URLs under 'Redirects':

* http://localhost:3000/api/auth/callback/discord
* http://domain:3000/api/auth/callback/discord

Make sure to change 'domain' in http://domain:3000/api/auth/callback/discord to your domain or public ip.

#### Lavalink
You can leave this as long as the values match your application.yml.
Expand All @@ -113,7 +119,7 @@ Create an application in each platform's developer portal and paste the relevant
1. If you followed everything right, hit `npm i` in the root folder. When it finishes make sure prisma didn't error.
2. Open a separate terminal in the root folder and run 'java -jar Lavalink.jar'.
3. Wait a few seconds and hit `npm run dev`.
4. If everything works, your bot should be running and the dashboard should be on localhost:3000.
4. If everything works, your bot and dashboard should be running.
5. Enjoy!

# Commands
Expand Down
1 change: 1 addition & 0 deletions packages/dashboard/src/env/schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { z } from "zod";
export const serverSchema = z.object({
NEXTAUTH_SECRET: z.string(),
NEXTAUTH_URL: z.string().url(),
NEXTAUTH_URL_INTERNAL: z.string().url().default("http://localhost:3000"),
DISCORD_CLIENT_ID: z.string(),
DISCORD_CLIENT_SECRET: z.string(),
});
Expand Down