sync and revoke auth refresh sessions
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-07-06 09:52:51 +09:00
parent 28b34f82de
commit 7c67e53b1e
2 changed files with 23 additions and 1 deletions
+11
View File
@@ -516,6 +516,17 @@ export async function revokeRefreshToken(refreshToken: string): Promise<void> {
])
}
export async function revokeRefreshTokensForUser(userId: string): Promise<void> {
await prisma.refreshToken.updateMany({
where: {
userId,
revokedAt: null,
expiresAt: { gt: new Date() }
},
data: { revokedAt: new Date() }
})
}
export async function createHandoffToken(userId: string, audienceApp: string): Promise<string> {
const token = createOpaqueToken()
await redis.set(