mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-02 17:29:43 +02:00
set last used cookie in smart login lookup
This commit is contained in:
+1
-1
@@ -1517,7 +1517,7 @@
|
|||||||
"otpAuthDescription": "Enter the code from your authenticator app or one of your single-use backup codes.",
|
"otpAuthDescription": "Enter the code from your authenticator app or one of your single-use backup codes.",
|
||||||
"otpAuthSubmit": "Submit Code",
|
"otpAuthSubmit": "Submit Code",
|
||||||
"idpContinue": "Or continue with",
|
"idpContinue": "Or continue with",
|
||||||
"idpLastUsed": "Last used",
|
"idpLastUsed": "Last Used",
|
||||||
"otpAuthBack": "Back to Password",
|
"otpAuthBack": "Back to Password",
|
||||||
"navbar": "Navigation Menu",
|
"navbar": "Navigation Menu",
|
||||||
"navbarDescription": "Main navigation menu for the application",
|
"navbarDescription": "Main navigation menu for the application",
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import {
|
|||||||
} from "next/navigation";
|
} from "next/navigation";
|
||||||
import { cleanRedirect } from "@app/lib/cleanRedirect";
|
import { cleanRedirect } from "@app/lib/cleanRedirect";
|
||||||
import { Separator } from "@app/components/ui/separator";
|
import { Separator } from "@app/components/ui/separator";
|
||||||
|
import { setClientCookie } from "@app/lib/setClientCookie";
|
||||||
|
import { LAST_USED_IDP_COOKIE_NAME } from "@app/lib/consts";
|
||||||
|
|
||||||
type SmartLoginOrgSelectorProps = {
|
type SmartLoginOrgSelectorProps = {
|
||||||
identifier: string;
|
identifier: string;
|
||||||
@@ -141,6 +143,17 @@ export default function SmartLoginOrgSelector({
|
|||||||
setPendingIdpId(idpId);
|
setPendingIdpId(idpId);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
|
setClientCookie(
|
||||||
|
LAST_USED_IDP_COOKIE_NAME,
|
||||||
|
JSON.stringify({
|
||||||
|
orgId,
|
||||||
|
idpId
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
sameSite: "Lax"
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let redirectToUrl: string | undefined;
|
let redirectToUrl: string | undefined;
|
||||||
try {
|
try {
|
||||||
const safeRedirect = cleanRedirect(redirect || "/");
|
const safeRedirect = cleanRedirect(redirect || "/");
|
||||||
|
|||||||
Reference in New Issue
Block a user