Skip to content

Commit

Permalink
Merge pull request #69 from diggerhq/hotfix-email-sending
Browse files Browse the repository at this point in the history
hotfix emai lsending
  • Loading branch information
ZIJ authored Oct 23, 2024
2 parents 5561aeb + 773e122 commit 63d7bb2
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 63d7bb2

Please sign in to comment.