fix: revert token masking in listSessions route (#6749)

This commit is contained in:
Taesu
2025-12-15 16:25:29 +09:00
committed by github-actions[bot]
parent 71dbe30ede
commit 0ba8989403

View File

@@ -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>>[],
);