Skip to content

Commit

Permalink
fix: reimplement callbackurl for redirect to signin
Browse files Browse the repository at this point in the history
  • Loading branch information
buckhalt committed May 3, 2024
1 parent c8e0429 commit ff3b90f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/dashboard/interviews/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { requirePageAuth } from '~/utils/auth';

export default async function InterviewPage() {
await requireAppNotExpired();
await requirePageAuth();
await requirePageAuth({ redirectPath: '/dashboard/interviews' });
return (
<>
<ResponsiveContainer>
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const dynamic = 'force-dynamic';

const Layout = async ({ children }: { children: React.ReactNode }) => {
await requireAppNotExpired();
await requirePageAuth();
await requirePageAuth({ redirectPath: '/dashboard' });

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function Home({
searchParams: Record<string, string | string[] | undefined>;
}) {
await requireAppNotExpired();
await requirePageAuth();
await requirePageAuth({ redirectPath: '/dashboard' });

searchParamsCache.parse(searchParams);

Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/participants/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { requirePageAuth } from '~/utils/auth';

export default async function ParticipantPage() {
await requireAppNotExpired();
await requirePageAuth();
await requirePageAuth({ redirectPath: '/dashboard/participants' });
return (
<>
<ResponsiveContainer>
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/protocols/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { requirePageAuth } from '~/utils/auth';

export default async function ProtocolsPage() {
await requireAppNotExpired();
await requirePageAuth();
await requirePageAuth({ redirectPath: '/dashboard/protocols' });
return (
<>
<ResponsiveContainer>
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { requirePageAuth } from '~/utils/auth';

export default async function Settings() {
await requireAppNotExpired();
await requirePageAuth();
await requirePageAuth({ redirectPath: '/dashboard/settings' });

const installationIdPromise = getInstallationId();

Expand Down
2 changes: 1 addition & 1 deletion utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function requirePageAuth(
redirect('/signin');
}

redirect('/signin');
redirect('/signin?callbackUrl=' + encodeURIComponent(redirectPath));
}
return session;
}
Expand Down

0 comments on commit ff3b90f

Please sign in to comment.