| @@ -72,6 +72,11 @@ | |||||
| Now let's set up your <br> Profile | Now let's set up your <br> Profile | ||||
| </header> | </header> | ||||
| <div class="input-holder"> | |||||
| <img src="assets/custom/name.svg"> | |||||
| <input type="text" placeholder="Username" [(ngModel)]="credentials.username"> | |||||
| </div> | |||||
| <div class="input-holder"> | <div class="input-holder"> | ||||
| <img src="assets/custom/email.svg"> | <img src="assets/custom/email.svg"> | ||||
| <input type="email" placeholder="Email ID" [(ngModel)]="credentials.email"> | <input type="email" placeholder="Email ID" [(ngModel)]="credentials.email"> | ||||
| @@ -18,7 +18,7 @@ export class OnboardingPage implements OnInit { | |||||
| email: '', | email: '', | ||||
| password: '', | password: '', | ||||
| role: [ | role: [ | ||||
| 'user' | |||||
| 'USER' | |||||
| ], | ], | ||||
| username: '' | username: '' | ||||
| } | } | ||||
| @@ -94,12 +94,12 @@ export class OnboardingPage implements OnInit { | |||||
| } | } | ||||
| registerUser() { | registerUser() { | ||||
| this.credentials.username = this.credentials.email; | |||||
| this.authService.signupUser(this.credentials).then((data) => { | this.authService.signupUser(this.credentials).then((data) => { | ||||
| console.log(data); | console.log(data); | ||||
| this.nextPage(); | this.nextPage(); | ||||
| }, (err) => { | }, (err) => { | ||||
| console.log(err); | console.log(err); | ||||
| this.nextPage(); | |||||
| this.toastService.presentToast("Failed to create user", "danger"); | this.toastService.presentToast("Failed to create user", "danger"); | ||||
| }); | }); | ||||
| } | } | ||||
| @@ -16,13 +16,15 @@ export class AuthService { | |||||
| } | } | ||||
| forgotPassword(email: string) { | 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 }) { | validateOtpForEmail(data: { email: string, otp: number | string }) { | ||||
| return this.http.post(URL + '/api/otp/validate', data).toPromise(); | return this.http.post(URL + '/api/otp/validate', data).toPromise(); | ||||
| } | } | ||||
| // POST/api/auth/otpvalidate For Forgot password | |||||
| requestMailOTP(email: string) { | requestMailOTP(email: string) { | ||||
| return this.http.post(URL + '/api/otp/generate/', { email: email }).toPromise(); | return this.http.post(URL + '/api/otp/generate/', { email: email }).toPromise(); | ||||
| } | } | ||||