Skip to content

Commit 5e67a92

Browse files
committed
chore: remove old anonymous session code
1 parent aff6bb3 commit 5e67a92

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

core/auth/index.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ const PasswordCredentials = z.object({
7878
cartId: cartIdSchema,
7979
});
8080

81-
const AnonymousCredentials = z.object({
82-
cartId: z.string().optional(),
83-
});
84-
8581
const JwtCredentials = z.object({
8682
jwt: z.string(),
8783
cartId: cartIdSchema,
@@ -192,14 +188,6 @@ async function loginWithJwt(credentials: unknown): Promise<User | null> {
192188
};
193189
}
194190

195-
function loginWithAnonymous(credentials: unknown): User | null {
196-
const { cartId } = AnonymousCredentials.parse(credentials);
197-
198-
return {
199-
cartId: cartId ?? null,
200-
};
201-
}
202-
203191
const config = {
204192
// Explicitly setting this value to be undefined. We want the library to handle CSRF checks when taking sensitive actions.
205193
// When handling sensitive actions like sign in, sign out, etc., the library will automatically check for CSRF tokens.
@@ -318,13 +306,6 @@ const config = {
318306
},
319307
authorize: loginWithPassword,
320308
}),
321-
CredentialsProvider({
322-
id: 'anonymous',
323-
credentials: {
324-
cartId: { type: 'text' },
325-
},
326-
authorize: loginWithAnonymous,
327-
}),
328309
CredentialsProvider({
329310
id: 'jwt',
330311
credentials: {

0 commit comments

Comments
 (0)