mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-18 15:20:10 -05:00
fix: backport sso deletion redirect
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { completeAccountDeletionSsoIdentityConfirmationAndGetRedirectPath } from "./lib/account-deletion-sso-complete";
|
||||
|
||||
export default async function AccountDeletionSsoConfirmationCompletePage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ intent?: string | string[] }>;
|
||||
}) {
|
||||
redirect(await completeAccountDeletionSsoIdentityConfirmationAndGetRedirectPath(await searchParams));
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { type NextRequest, NextResponse } from "next/server";
|
||||
import { completeAccountDeletionSsoIdentityConfirmationAndGetRedirectPath } from "./lib/account-deletion-sso-complete";
|
||||
|
||||
const getIntentSearchParam = (request: NextRequest): string | string[] | undefined => {
|
||||
const intentValues = request.nextUrl.searchParams.getAll("intent");
|
||||
|
||||
if (intentValues.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return intentValues.length === 1 ? intentValues[0] : intentValues;
|
||||
};
|
||||
|
||||
export const GET = async (request: NextRequest) => {
|
||||
const redirectPath = await completeAccountDeletionSsoIdentityConfirmationAndGetRedirectPath({
|
||||
intent: getIntentSearchParam(request),
|
||||
});
|
||||
|
||||
return NextResponse.redirect(new URL(redirectPath, request.url));
|
||||
};
|
||||
Reference in New Issue
Block a user