File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apps/api/src/modules/auth Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments