diff --git a/src/models/creation/RefreshAuth.ts b/src/models/creation/RefreshAuth.ts index f9010ce..96721ab 100644 --- a/src/models/creation/RefreshAuth.ts +++ b/src/models/creation/RefreshAuth.ts @@ -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; } } \ No newline at end of file