mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-27 17:36:42 -05:00
refactor(multi-session): remove cookie filter
This commit is contained in:
@@ -197,12 +197,10 @@ export const multiSession = (options?: MultiSessionConfig) => {
|
||||
if (setCookies.get(cookieName) || cookies.get(cookieName)) return;
|
||||
|
||||
const currentMultiSessions =
|
||||
Object.keys(cookies).filter(isMultiSessionCookie).length;
|
||||
const toBeAdded = Object.keys(setCookies).filter((key) =>
|
||||
key.includes("session_token"),
|
||||
).length;
|
||||
Object.keys(cookies).filter(isMultiSessionCookie).length +
|
||||
(cookieString.includes("session_token") ? 1 : 0);
|
||||
|
||||
if (currentMultiSessions + toBeAdded > opts.maximumSessions) {
|
||||
if (currentMultiSessions > opts.maximumSessions) {
|
||||
throw new APIError("UNAUTHORIZED", {
|
||||
message: "Maximum number of device sessions reached.",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user