@@ -30,7 +30,9 @@ export class AuthService {
30
30
async logout ( userAuth : UserInAuth ) {
31
31
32
32
try {
33
- this . userDevicesRepository . update ( {
33
+ console . log ( userAuth . id )
34
+ console . log ( userAuth . deviceUniqueId ) ;
35
+ await this . userDevicesRepository . update ( {
34
36
user_id : userAuth . id ,
35
37
unique_id : userAuth . deviceUniqueId ,
36
38
} , {
@@ -59,7 +61,7 @@ export class AuthService {
59
61
60
62
const token = req . header ( 'authorization' ) . replace ( 'Bearer ' , '' ) ;
61
63
console . log ( device . refresh_token )
62
- if ( ! await this . checkPassword ( token , device . refresh_token ) ) {
64
+ if ( ! await this . checkPassword ( token , device . refresh_token ?? '' ) ) {
63
65
throw new HttpException ( this . i18n . t ( 'auth.refresh.invalid-token' ) , HttpStatus . BAD_REQUEST ) ;
64
66
}
65
67
@@ -85,18 +87,6 @@ export class AuthService {
85
87
return {
86
88
tokens
87
89
} ;
88
-
89
- // await this.userDevicesRepository.update({
90
- // id: device.id,
91
- // }, {
92
- // refresh_token: null,
93
- // access_token: null,
94
- // })
95
-
96
- // return this.i18n.t('auth.refresh.response-success')
97
- // console.log(device);
98
-
99
- // this.checkPassword()
100
90
}
101
91
102
92
async login ( data : LoginDTO , req : Request ) {
0 commit comments