basic RefreshAuth checking

ref #12
This commit is contained in:
Philipp Dormann 2020-12-05 13:07:33 +01:00
parent 82f31185a1
commit 126799dab9
1 changed files with 8 additions and 6 deletions

View File

@ -20,12 +20,7 @@ export class RefreshAuth {
} catch (error) {
throw new IllegalJWTError()
}
const found_user = found_users[0]
delete found_user.password;
newAuth.access_token = "ja"
newAuth.access_token_expires_at = 5555555
newAuth.refresh_token = "ja"
newAuth.refresh_token_expires_at = 555555
console.log(decoded["userid"]);
const found_user = await getConnectionManager().get().getRepository(User).findOne({ id: decoded["userid"] });
if (!found_user) {
throw new UserNotFoundError()
@ -33,6 +28,13 @@ export class RefreshAuth {
if (found_user.refreshTokenCount !== decoded["refreshtokencount"]) {
throw new RefreshTokenCountInvalidError()
}
console.log(found_user);
// delete found_user.password;
newAuth.access_token = "ja"
newAuth.access_token_expires_at = 5555555
newAuth.refresh_token = "ja"
newAuth.refresh_token_expires_at = 555555
return newAuth;
}
}