jwt thoughts and fixes

This commit is contained in:
Ulf Gebhardt 2021-06-29 13:07:04 +02:00
parent fd54febd24
commit 81afd9d78f
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD

View File

@ -51,7 +51,12 @@ export class UserResolver {
}
// create and return the json web token
return jwt.sign({ result }, CONFIG.JWT_SECRET, { expiresIn: CONFIG.JWT_EXPIRES_IN })
// The expire doesn't help us here. The client needs to track when the token expires on its own,
// since every action prolongs the time the session is valid.
return jwt.sign(
{ result, role: 'todo' },
CONFIG.JWT_SECRET /* , { expiresIn: CONFIG.JWT_EXPIRES_IN } */,
)
// return (await apiPost(CONFIG.LOGIN_API_URL + 'unsecureLogin', login)).result.data
// const loginResult: LoginResult = await loginAPI.login(data)
// return loginResult.user ? loginResult.user : new User()