mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-04-25 15:41:36 -05:00
feat: give token models a TTL index
This commit is contained in:
parent
822c8fb5ab
commit
685f45a342
|
|
@ -38,4 +38,6 @@ const IndependentServiceTokenSchema = new Schema<IIndependentServiceToken, Indep
|
|||
}
|
||||
});
|
||||
|
||||
IndependentServiceTokenSchema.index({ 'info.expires': 1 }, { expireAfterSeconds: 0 });
|
||||
|
||||
export const IndependentServiceToken = model<IIndependentServiceToken, IndependentServiceTokenModel>('IndependentServiceToken', IndependentServiceTokenSchema);
|
||||
|
|
|
|||
|
|
@ -36,4 +36,6 @@ const NEXTokenSchema = new Schema<INEXToken, NEXTokenModel, INEXTokenMethods>({
|
|||
}
|
||||
});
|
||||
|
||||
NEXTokenSchema.index({ 'info.expires': 1 }, { expireAfterSeconds: 0 });
|
||||
|
||||
export const NEXToken = model<INEXToken, NEXTokenModel>('NEXToken', NEXTokenSchema);
|
||||
|
|
|
|||
|
|
@ -38,4 +38,6 @@ const OAuthTokenSchema = new Schema<IOAuthToken, OAuthTokenModel, IOAuthTokenMet
|
|||
}
|
||||
});
|
||||
|
||||
OAuthTokenSchema.index({ 'info.expires': 1 }, { expireAfterSeconds: 0 });
|
||||
|
||||
export const OAuthToken = model<IOAuthToken, OAuthTokenModel>('OAuthToken', OAuthTokenSchema);
|
||||
|
|
|
|||
|
|
@ -34,4 +34,6 @@ const PasswordResetTokenSchema = new Schema<IPasswordResetToken, PasswordResetTo
|
|||
}
|
||||
});
|
||||
|
||||
PasswordResetTokenSchema.index({ 'info.expires': 1 }, { expireAfterSeconds: 0 });
|
||||
|
||||
export const PasswordResetToken = model<IPasswordResetToken, PasswordResetTokenModel>('PasswordResetToken', PasswordResetTokenSchema);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user