Browse Source

API change for forgot password, param default change for register user

master
kj1352 5 years ago
parent
commit
84b781f7f5
3 changed files with 10 additions and 3 deletions
  1. +5
    -0
      src/app/onboarding/onboarding.page.html
  2. +2
    -2
      src/app/onboarding/onboarding.page.ts
  3. +3
    -1
      src/app/services/auth.service.ts

+ 5
- 0
src/app/onboarding/onboarding.page.html View File

@@ -72,6 +72,11 @@
Now let's set up your <br> Profile
</header>

<div class="input-holder">
<img src="assets/custom/name.svg">
<input type="text" placeholder="Username" [(ngModel)]="credentials.username">
</div>

<div class="input-holder">
<img src="assets/custom/email.svg">
<input type="email" placeholder="Email ID" [(ngModel)]="credentials.email">


+ 2
- 2
src/app/onboarding/onboarding.page.ts View File

@@ -18,7 +18,7 @@ export class OnboardingPage implements OnInit {
email: '',
password: '',
role: [
'user'
'USER'
],
username: ''
}
@@ -94,12 +94,12 @@ export class OnboardingPage implements OnInit {
}

registerUser() {
this.credentials.username = this.credentials.email;
this.authService.signupUser(this.credentials).then((data) => {
console.log(data);
this.nextPage();
}, (err) => {
console.log(err);
this.nextPage();
this.toastService.presentToast("Failed to create user", "danger");
});
}


+ 3
- 1
src/app/services/auth.service.ts View File

@@ -16,13 +16,15 @@ export class AuthService {
}

forgotPassword(email: string) {
return this.http.post(URL + '/api/auth/forgot/', { email: email }).toPromise();
return this.http.post(URL + '/forgot', { email: email }).toPromise();
}

validateOtpForEmail(data: { email: string, otp: number | string }) {
return this.http.post(URL + '/api/otp/validate', data).toPromise();
}

// POST/api/auth/otpvalidate For Forgot password

requestMailOTP(email: string) {
return this.http.post(URL + '/api/otp/generate/', { email: email }).toPromise();
}


Loading…
Cancel
Save