feat(auth): added in a rolling token

This commit is contained in:
2025-03-05 12:10:09 -06:00
parent 5fcadb9fc8
commit 50cf87380d
5 changed files with 73 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ import {log} from "../../logger/logger.js";
/**
* Authenticate a user and return a JWT.
*/
const {sign, verify} = jwt;
const {sign} = jwt;
export async function login(
username: string,
@@ -56,5 +56,6 @@ export async function login(
}
const token = sign({user: userData}, secret, {expiresIn: expiresIn * 60});
return {token, user: userData};
}