Skip to content

Commit

Permalink
fix: 🐛 fixed issue with login on preview instance
Browse files Browse the repository at this point in the history
  • Loading branch information
WasiqB committed Feb 15, 2025
1 parent b33cc48 commit 2f24a59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/web/app/(auth)/auth/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NextResponse } from 'next/server';
export async function GET(request: Request) {
const { searchParams, origin } = new URL(request.url);
const code = searchParams.get('code');
const next = searchParams.get('next') ?? '/';
const next = searchParams.get('next') ?? '/dashboard';

if (isPreview) {
logger.debug('====================');
Expand Down
9 changes: 4 additions & 5 deletions apps/web/app/utils/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ const signInWith = (provider: Provider) => async () => {

if (error) {
logger.error(`Error while signing in with ${provider}: ${error.message}`);
} else {
}
if (data?.url) {
if (isPreview) {
logger.debug('====================');
logger.debug(`Success Login data: ${JSON.stringify(data)}`);
logger.debug('====================');
logger.debug(`Actions Redirecting to: ${data.url}`);
}
redirect('/dashboard');
redirect(data.url);
}
};

Expand Down

0 comments on commit 2f24a59

Please sign in to comment.