Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/app/api/auth/github/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function err(req: NextRequest, code: string): NextResponse {
}

export async function GET(req: NextRequest) {
const clientId = process.env.GITHUB_OAUTH_CLIENT_ID;
const clientSecret = process.env.GITHUB_OAUTH_CLIENT_SECRET;
const clientId = process.env.GITHUB_OAUTH_CLIENT_ID?.trim();
const clientSecret = process.env.GITHUB_OAUTH_CLIENT_SECRET?.trim();
if (!clientId || !clientSecret) return err(req, 'oauth_not_configured');

const code = req.nextUrl.searchParams.get('code');
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/auth/github/login/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const NEXT_COOKIE = 'gh_oauth_next';
const STATE_MAX_AGE_SEC = 600; // 10 min — plenty for the round-trip

export async function GET(req: NextRequest) {
const clientId = process.env.GITHUB_OAUTH_CLIENT_ID;
const clientId = process.env.GITHUB_OAUTH_CLIENT_ID?.trim();
if (!clientId) {
return NextResponse.json({ error: 'GITHUB_OAUTH_CLIENT_ID not set' }, { status: 500 });
}
Expand Down