[Feature][Sheen] added never expire service token

This commit is contained in:
Sheen
2023-04-15 15:50:06 +08:00
parent 56c35293eb
commit c1f39b866f
2 changed files with 10 additions and 6 deletions
@@ -75,8 +75,11 @@ export const createServiceTokenData = async (req: Request, res: Response) => {
const secret = crypto.randomBytes(16).toString('hex');
const secretHash = await bcrypt.hash(secret, getSaltRounds());
const expiresAt = new Date();
expiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);
let expiresAt;
if (!!expiresIn) {
expiresAt = new Date()
expiresAt.setSeconds(expiresAt.getSeconds() + expiresIn);
}
let user, serviceAccount;