mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-13 17:21:48 +02:00
♻️ delete last used IDP coookie when logging in with email/password on smart login form
This commit is contained in:
@@ -22,6 +22,8 @@ import Link from "next/link";
|
|||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
import { cleanRedirect } from "@app/lib/cleanRedirect";
|
import { cleanRedirect } from "@app/lib/cleanRedirect";
|
||||||
import MfaInputForm from "@app/components/MfaInputForm";
|
import MfaInputForm from "@app/components/MfaInputForm";
|
||||||
|
import { LAST_USED_IDP_COOKIE_NAME } from "@app/lib/consts";
|
||||||
|
import { setClientCookie } from "@app/lib/setClientCookie";
|
||||||
|
|
||||||
type LoginPasswordFormProps = {
|
type LoginPasswordFormProps = {
|
||||||
identifier: string;
|
identifier: string;
|
||||||
@@ -82,6 +84,12 @@ export default function LoginPasswordForm({
|
|||||||
const { password } = values;
|
const { password } = values;
|
||||||
const { code } = mfaForm.getValues();
|
const { code } = mfaForm.getValues();
|
||||||
|
|
||||||
|
// delete last used auth cookie by setting it in the past
|
||||||
|
setClientCookie(LAST_USED_IDP_COOKIE_NAME, JSON.stringify(null), {
|
||||||
|
sameSite: "Lax",
|
||||||
|
days: -1
|
||||||
|
});
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user