diff --git a/bookie/src/app/auth/auth.service.ts b/bookie/src/app/auth/auth.service.ts
index c658f60..deabf6a 100644
--- a/bookie/src/app/auth/auth.service.ts
+++ b/bookie/src/app/auth/auth.service.ts
@@ -82,11 +82,10 @@ export class AuthService {
return this.currentUserSubject.value;
}
- login(username: string, password: string, otp: string) {
+ login(username: string, password: string) {
const formData: FormData = new FormData();
formData.append('username', username);
formData.append('password', password);
- formData.append('otp', otp);
formData.append('grant_type', 'password');
return this.http
.post<{ access_token: string; token_type: string }>(loginUrl, formData)
diff --git a/bookie/src/app/auth/login/login.component.html b/bookie/src/app/auth/login/login.component.html
index 1a2e4d0..7461577 100644
--- a/bookie/src/app/auth/login/login.component.html
+++ b/bookie/src/app/auth/login/login.component.html
@@ -26,31 +26,7 @@
-
Client ID: {{ clientId }}
-
-
- Otp
-
-
-
-
-
- Client Name
-
-
-
+ Sorry, device {{ deviceName }} is not enabled.
diff --git a/bookie/src/app/auth/login/login.component.ts b/bookie/src/app/auth/login/login.component.ts
index feeda0b..74d9901 100644
--- a/bookie/src/app/auth/login/login.component.ts
+++ b/bookie/src/app/auth/login/login.component.ts
@@ -15,8 +15,8 @@ export class LoginComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
form: FormGroup;
hide: boolean;
- showOtp: boolean;
- clientId: string;
+ unregisteredDevice: boolean;
+ deviceName: string;
private returnUrl: string;
constructor(
@@ -28,8 +28,8 @@ export class LoginComponent implements OnInit, AfterViewInit {
private fb: FormBuilder,
) {
this.hide = true;
- this.showOtp = false;
- this.clientId = '';
+ this.unregisteredDevice = false;
+ this.deviceName = '';
this.returnUrl = '';
// Create form
@@ -56,9 +56,8 @@ export class LoginComponent implements OnInit, AfterViewInit {
const formModel = this.form.value;
const { username } = formModel;
const { password } = formModel;
- const { otp } = formModel;
this.auth
- .login(username, password, otp)
+ .login(username, password)
// .pipe(first())
.subscribe(
() => {
@@ -66,8 +65,8 @@ export class LoginComponent implements OnInit, AfterViewInit {
},
(error) => {
if (error.status === 401 && error.error.detail === 'Device is not registered') {
- this.showOtp = true;
- this.clientId = this.cs.getCookie('device_id');
+ this.unregisteredDevice = true;
+ this.deviceName = this.cs.getCookie('device');
}
this.toaster.show('Error', error.error.detail);
},