Skip to content

Commit

Permalink
hotfix emai lsending
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes committed Oct 23, 2024
1 parent 5561aeb commit 773e122
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/app/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { NextResponse } from 'next/server';
export const dynamic = 'force-dynamic';

export async function GET() {
if (process.env.NEXT_PUBLIC_SSO_DOMAIN !== undefined) {
return NextResponse.redirect(
new URL('/auth/sso-verify', process.env.NEXT_PUBLIC_SITE_URL),
);
}

const supabase = createSupabaseUserRouteHandlerClient();

const {
Expand Down
7 changes: 5 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ export async function middleware(req: NextRequest) {
{ supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL },
);

if (req.nextUrl.pathname === '/') {
return res;
if (
process.env.NEXT_PUBLIC_SSO_DOMAIN !== undefined &&
req.nextUrl.pathname === '/'
) {
return NextResponse.redirect(toSiteURL('/auth/sso-verify'));
}

const sessionResponse = await supabase.auth.getSession();
Expand Down

0 comments on commit 773e122

Please sign in to comment.