Fix: Login errors were not helpful as error.details NOTICE THE "S" typo gobbled up the error message.

Also changed client to device
This commit is contained in:
Amritanshu Agrawal 2021-06-26 08:46:22 +05:30
parent e0ef5e7b64
commit 77dad64eab

View File

@ -65,11 +65,11 @@ export class LoginComponent implements OnInit, AfterViewInit {
this.router.navigate([this.returnUrl]);
},
(error) => {
if (error.status === 401 && error.error.detail === 'Client is not registered') {
if (error.status === 401 && error.error.detail === 'Device is not registered') {
this.showOtp = true;
this.clientId = this.cs.getCookie('client_id');
this.clientId = this.cs.getCookie('device_id');
}
this.toaster.show('Error', error.error.details);
this.toaster.show('Error', error.error.detail);
},
);
}