Skip to content

Commit 3bface4

Browse files
authored
Fix extension auth deeplink (#143)
1 parent b12271d commit 3bface4

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

apps/web/.env

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_ZXBpYy1jaGFtb2lzLTg1LmNsZXJrLmFjY291bnRzLmRldiQ
33
NEXT_PUBLIC_CLERK_FRONTEND_API=https://epic-chamois-85.clerk.accounts.dev
4+
5+
# https://clerk.com/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects
46
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
5-
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL=/
6-
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/
77
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
8-
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL=/
9-
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/
8+
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL=/authorized
9+
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL=/authorized
10+
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/authorized
11+
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/authorized

apps/web/src/app/(authenticated)/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default async function AuthenticatedLayout({
2323
// Set enhanced Sentry context for authenticated users.
2424
const { userId, orgId, orgRole } = authResult;
2525
setSentryUserContext({ id: userId, orgId, orgRole });
26+
2627
if (orgId && orgRole) {
2728
setSentryOrganizationContext(orgId, orgRole);
2829
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use client';
2+
3+
import { useEffect } from 'react';
4+
import { LoaderCircle } from 'lucide-react';
5+
6+
export default function Page() {
7+
useEffect(() => {
8+
setTimeout(() => {
9+
window.location.href = '/sign-in';
10+
}, 1000);
11+
}, []);
12+
13+
return (
14+
<div className="flex justify-center">
15+
<LoaderCircle className="animate-spin" />
16+
</div>
17+
);
18+
}

apps/web/src/components/layout/AuthProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const AuthProvider = ({
2323
<ClerkProvider
2424
appearance={{ baseTheme }}
2525
localization={localization}
26-
afterSignOutUrl={'/sign-in'}
26+
afterSignOutUrl={'/signed-out'}
2727
>
2828
<SentryUserContext />
2929
{children}

apps/web/src/middleware.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const isUnprotectedRoute = createRouteMatcher([
77
'/extension/sign-in(.*)',
88
'/api/marketplace(.*)',
99
'/share(.*)',
10+
'/signed-out(.*)',
1011
'/',
1112
]);
1213

0 commit comments

Comments
 (0)