Skip to content

Commit

Permalink
Drop cookie on login
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed May 24, 2024
1 parent 9b1f631 commit a084f2e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/keychain/src/components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import {
Formik,
useFormikContext,
} from "formik";
import {
PortalBanner,
PortalFooter,
} from "components";
import { PortalBanner, PortalFooter } from "components";
import { useCallback, useState } from "react";
import Controller from "utils/controller";
import { FormValues, LoginProps } from "./types";
Expand All @@ -19,7 +16,7 @@ import { beginLogin, onLoginFinalize } from "hooks/account";
import { WebauthnSigner } from "utils/webauthn";
import base64url from "base64url";
import { useClearField } from "./hooks";
import { fetchAccount, validateUsernameFor } from "./utils";
import { dropCookie, fetchAccount, validateUsernameFor } from "./utils";
import { RegistrationLink } from "./RegistrationLink";
import { useControllerTheme } from "hooks/theme";

Expand Down Expand Up @@ -50,6 +47,7 @@ export function Login({

try {
log({ type: "webauthn_login", address });
await dropCookie();

const { data: beginLoginData } = await beginLogin(values.username);
const signer = new WebauthnSigner(credentialId, publicKey);
Expand Down Expand Up @@ -124,7 +122,11 @@ function Form({
return (
<FormikForm style={{ width: "100%" }}>
<PortalBanner
title={theme.id === "cartridge" ? "Play with Cartridge Controller" : `Play ${theme.name}`}
title={
theme.id === "cartridge"
? "Play with Cartridge Controller"
: `Play ${theme.name}`
}
description="Enter your Controller username"
/>

Expand Down

0 comments on commit a084f2e

Please sign in to comment.