lucia-auth / lucia

Authentication, simple and clean
https://lucia-auth.com
MIT License
8.29k stars 446 forks source link

[Feature Request]: deleteUserSessions except for the current #1592

Open reslear opened 3 weeks ago

reslear commented 3 weeks ago

Package

lucia

Description

Terminates all user's authorized sessions except for the current one.

like https://core.telegram.org/method/auth.resetAuthorizations

deleteUserSessionsExceptCurrent()

// or 

type deleteUserSessions = (except_current: boolean) => boolean

deleteUserSessions(true)

before:

session:1
session:2
session:3
session:4

after:

session:2
pilcrowOnPaper commented 3 weeks ago

I could add this in v4, though for now this should be good enough:

await lucia.invalidateUserSessions();
const newSession = await lucia.createSession();
doroved commented 1 week ago

I could add this in v4, though for now this should be good enough:

Remind me, when do you plan to release v4? Early 2025?

pilcrowOnPaper commented 1 week ago

@doroved early 2025