mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-31 19:36:46 -05:00
fix: revert token masking in listSessions route (#6749)
This commit is contained in:
committed by
github-actions[bot]
parent
71dbe30ede
commit
0ba8989403
@@ -600,16 +600,9 @@ export const listSessions = <Option extends BetterAuthOptions>() =>
|
||||
const sessions = await ctx.context.internalAdapter.listSessions(
|
||||
ctx.context.session.user.id,
|
||||
);
|
||||
const activeSessions = sessions
|
||||
.filter((session) => {
|
||||
return session.expiresAt > new Date();
|
||||
})
|
||||
.map((session) => {
|
||||
return {
|
||||
...session,
|
||||
token: "", // we don't need to return the token to the client
|
||||
};
|
||||
});
|
||||
const activeSessions = sessions.filter((session) => {
|
||||
return session.expiresAt > new Date();
|
||||
});
|
||||
return ctx.json(
|
||||
activeSessions as unknown as Prettify<InferSession<Option>>[],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user