This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user