refactor(api): return both refresh and access tokens at login endpoint

This commit is contained in:
parent 4139f6fd58
commit ce11745bd0
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -28,11 +28,14 @@ export default eventHandler(async (event) => {
message: 'Account inactive!<br><a href="/activate/resend">Resend verification</a>?',
});
}
let tok = user.generateJWT(useRuntimeConfig().jwt);
let tok = user.generateRefreshToken(useRuntimeConfig().jwt);
// setCookie(event, "rockfic_cookie", tok);
return {
user,
token: tok,
token: {
refresh: tok,
access: user.generateAccessToken(useRuntimeConfig().jwt),
},
};
} else {
throw createError({ statusCode: 401, message: wrongMsg });