remove deleteMany call to allow reuse of refresh tokens in generateAuthToken method

This commit is contained in:
paritosh18
2026-03-05 18:44:57 +05:30
parent 5d046c4bcf
commit 90c897ad48

View File

@@ -53,10 +53,10 @@ export class TokenService {
config.jwt.secret
);
await this.prisma.token.deleteMany({
where: { userXid: user_xid }
})
// Optionally keep existing refresh tokens alive instead of deleting
// Removed deleteMany call so the same refresh token can be used multiple
// times. If you want to limit refresh tokens later you can implement
// rotation or blacklist logic elsewhere.
await this.prisma.token.create({
data: {
token: refreshToken.token,