Skip to content

Commit 78f274a

Browse files
author
hersveit
committed
fix user var name
1 parent 1acb1b2 commit 78f274a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/api/src/modules/auth/auth.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ export class AuthService {
3434

3535
async signIn(body: SignInBody): Promise<GetTokenResult | UserNotFound> {
3636
const hash = SHA256(body.password).toString();
37-
const admin = await this.rep.user.findOne({ where: { email: body.email, hash } });
37+
const user = await this.rep.user.findOne({ where: { email: body.email, hash } });
3838

39-
if (!admin) {
39+
if (!user) {
4040
return new UserNotFound({ email: body.email });
4141
}
4242

43-
const { accessToken, refreshToken, refreshTokenHash } = this.generateToken(admin.id);
44-
await this.rep.user.save({ id: admin.id, refreshTokenHash });
43+
const { accessToken, refreshToken, refreshTokenHash } = this.generateToken(user.id);
44+
await this.rep.user.save({ id: user.id, refreshTokenHash });
4545

4646
return {
4747
token: accessToken,

0 commit comments

Comments
 (0)