mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-24 08:01:56 -05:00
chore: use prefix for last login method
This commit is contained in:
@@ -230,7 +230,7 @@ export const auth = betterAuth({
|
||||
plugins: [
|
||||
lastLoginMethod({
|
||||
// Cookie configuration
|
||||
cookieName: "last_used_login_method", // Default: "last_used_login_method"
|
||||
cookieName: "better-auth.last_used_login_method", // Default: "better-auth.last_used_login_method"
|
||||
maxAge: 60 * 60 * 24 * 30, // Default: 30 days in seconds
|
||||
|
||||
// Database persistence
|
||||
@@ -259,7 +259,7 @@ export const auth = betterAuth({
|
||||
|
||||
**cookieName**: `string`
|
||||
- The name of the cookie used to store the last login method
|
||||
- Default: `"last_used_login_method"`
|
||||
- Default: `"better-auth.last_used_login_method"`
|
||||
|
||||
**maxAge**: `number`
|
||||
- Cookie expiration time in seconds
|
||||
@@ -288,7 +288,7 @@ import { lastLoginMethodClient } from "better-auth/client/plugins"
|
||||
export const authClient = createAuthClient({
|
||||
plugins: [
|
||||
lastLoginMethodClient({
|
||||
cookieName: "last_used_login_method" // Default: "last_used_login_method"
|
||||
cookieName: "better-auth.last_used_login_method" // Default: "better-auth.last_used_login_method"
|
||||
})
|
||||
]
|
||||
})
|
||||
@@ -297,7 +297,7 @@ export const authClient = createAuthClient({
|
||||
**cookieName**: `string`
|
||||
- The name of the cookie to read the last login method from
|
||||
- Must match the server-side `cookieName` configuration
|
||||
- Default: `"last_used_login_method"`
|
||||
- Default: `"better-auth.last_used_login_method"`
|
||||
|
||||
### Default Method Resolution
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ export const lastLoginMethod = <O extends LastLoginMethodOptions>(
|
||||
"/sign-up/email",
|
||||
];
|
||||
const config = {
|
||||
cookieName: "last_used_login_method",
|
||||
cookieName: "better-auth.last_used_login_method",
|
||||
maxAge: 60 * 60 * 24 * 30,
|
||||
customResolveMethod: (ctx) => {
|
||||
if (paths.includes(ctx.path)) {
|
||||
|
||||
Reference in New Issue
Block a user