Add support for refresh token

This commit is contained in:
2023-07-15 15:38:15 +08:00
parent a573d60191
commit bddbbb684d
3 changed files with 52 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ export const handler: Handlers = {
if (!isEqual(pa, password)) {
return return_error(4, USER_PASSWORD_ERROR);
}
const token = m.db.add_token(u.id, now);
const token = m.db.add_token(u.id, now, http_only, secure);
const headers: HeadersInit = {};
if (set_cookie) {
headers["Set-Cookie"] =