| @@ -5,14 +5,15 @@ const routes: Routes = [ | |||||
| { path: '', redirectTo: 'login', pathMatch: 'full' }, | { path: '', redirectTo: 'login', pathMatch: 'full' }, | ||||
| { path: 'onboarding', loadChildren: './onboarding/onboarding.module#OnboardingPageModule' }, | { path: 'onboarding', loadChildren: './onboarding/onboarding.module#OnboardingPageModule' }, | ||||
| { path: 'login', loadChildren: './login/login.module#LoginPageModule' }, | { path: 'login', loadChildren: './login/login.module#LoginPageModule' }, | ||||
| { path: 'forgot-password', loadChildren: './forgot-password/forgot-password.module#ForgotPasswordPageModule' }, | |||||
| { path: 'malls', loadChildren: './malls/malls.module#MallsPageModule' }, | { path: 'malls', loadChildren: './malls/malls.module#MallsPageModule' }, | ||||
| { path: 'mall-details', loadChildren: './mall-details/mall-details.module#MallDetailsPageModule' }, | { path: 'mall-details', loadChildren: './mall-details/mall-details.module#MallDetailsPageModule' }, | ||||
| { path: 'outlet-details', loadChildren: './outlet-details/outlet-details.module#OutletDetailsPageModule' }, | { path: 'outlet-details', loadChildren: './outlet-details/outlet-details.module#OutletDetailsPageModule' }, | ||||
| { path: 'cart', loadChildren: './cart/cart.module#CartPageModule' }, | { path: 'cart', loadChildren: './cart/cart.module#CartPageModule' }, | ||||
| { path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }, | { path: 'profile', loadChildren: './profile/profile.module#ProfilePageModule' }, | ||||
| { path: 'bookmark', loadChildren: './bookmark/bookmark.module#BookmarkPageModule' }, | { path: 'bookmark', loadChildren: './bookmark/bookmark.module#BookmarkPageModule' }, | ||||
| { path: 'near', loadChildren: './near/near.module#NearPageModule' }, { path: 'in-app-browser', loadChildren: './in-app-browser/in-app-browser.module#InAppBrowserPageModule' }, | |||||
| { path: 'near', loadChildren: './near/near.module#NearPageModule' }, | |||||
| { path: 'in-app-browser', loadChildren: './in-app-browser/in-app-browser.module#InAppBrowserPageModule' }, | |||||
| ]; | ]; | ||||
| @NgModule({ | @NgModule({ | ||||
| @@ -0,0 +1,26 @@ | |||||
| import { NgModule } from '@angular/core'; | |||||
| import { CommonModule } from '@angular/common'; | |||||
| import { FormsModule } from '@angular/forms'; | |||||
| import { Routes, RouterModule } from '@angular/router'; | |||||
| import { IonicModule } from '@ionic/angular'; | |||||
| import { ForgotPasswordPage } from './forgot-password.page'; | |||||
| const routes: Routes = [ | |||||
| { | |||||
| path: '', | |||||
| component: ForgotPasswordPage | |||||
| } | |||||
| ]; | |||||
| @NgModule({ | |||||
| imports: [ | |||||
| CommonModule, | |||||
| FormsModule, | |||||
| IonicModule, | |||||
| RouterModule.forChild(routes) | |||||
| ], | |||||
| declarations: [ForgotPasswordPage] | |||||
| }) | |||||
| export class ForgotPasswordPageModule {} | |||||
| @@ -0,0 +1,18 @@ | |||||
| <ion-content> | |||||
| <section class="login"> | |||||
| <header> | |||||
| Reset Password | |||||
| </header> | |||||
| <p class="description"> | |||||
| Please enter to your email | |||||
| </p> | |||||
| <div class="input-holder"> | |||||
| <input type="email" placeholder="Email ID" [(ngModel)]="email"> | |||||
| </div> | |||||
| <ion-button class="login-button" shape="round" size="block" (click)="getOtp()"> Get OTP </ion-button> | |||||
| <p class="signin-description"> <a [routerLink]="['/login']"> Login </a> </p> | |||||
| </section> | |||||
| </ion-content> | |||||
| @@ -0,0 +1 @@ | |||||
| @import '../login/login.page.scss'; | |||||
| @@ -0,0 +1,27 @@ | |||||
| import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | |||||
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { ForgotPasswordPage } from './forgot-password.page'; | |||||
| describe('ForgotPasswordPage', () => { | |||||
| let component: ForgotPasswordPage; | |||||
| let fixture: ComponentFixture<ForgotPasswordPage>; | |||||
| beforeEach(async(() => { | |||||
| TestBed.configureTestingModule({ | |||||
| declarations: [ ForgotPasswordPage ], | |||||
| schemas: [CUSTOM_ELEMENTS_SCHEMA], | |||||
| }) | |||||
| .compileComponents(); | |||||
| })); | |||||
| beforeEach(() => { | |||||
| fixture = TestBed.createComponent(ForgotPasswordPage); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -0,0 +1,31 @@ | |||||
| import { Component, OnInit } from '@angular/core'; | |||||
| import { AuthService } from '../services/auth.service'; | |||||
| import { ToastService } from '../services/toast.service'; | |||||
| @Component({ | |||||
| selector: 'app-forgot-password', | |||||
| templateUrl: './forgot-password.page.html', | |||||
| styleUrls: ['./forgot-password.page.scss'], | |||||
| }) | |||||
| export class ForgotPasswordPage implements OnInit { | |||||
| email: string = ''; | |||||
| constructor( | |||||
| private authService: AuthService, | |||||
| private toastService: ToastService | |||||
| ) { } | |||||
| ngOnInit() { | |||||
| } | |||||
| getOtp() { | |||||
| this.authService.forgotPassword(this.email).then((data) => { | |||||
| console.log(data); | |||||
| this.toastService.presentToast("OTP Sent to your Email ID", "success"); | |||||
| }, (err) => { | |||||
| console.log(err); | |||||
| this.toastService.presentToast("Failed to send OTP, Please check your credentials", "danger"); | |||||
| }); | |||||
| } | |||||
| } | |||||
| @@ -21,7 +21,7 @@ | |||||
| <ion-icon name="eye-off" *ngIf="show_password" (click)="show_password = !show_password"></ion-icon> | <ion-icon name="eye-off" *ngIf="show_password" (click)="show_password = !show_password"></ion-icon> | ||||
| </div> | </div> | ||||
| <a class="forgot-link"> Forgot Password? </a> | |||||
| <a class="forgot-link" [routerLink]="['/forgot-password']"> Forgot Password? </a> | |||||
| <ion-button class="login-button" shape="round" size="block" (click)="login()"> Sign In </ion-button> | <ion-button class="login-button" shape="round" size="block" (click)="login()"> Sign In </ion-button> | ||||
| @@ -15,6 +15,10 @@ export class AuthService { | |||||
| return this.http.post(URL + '/api/auth/signin/', credentials).toPromise(); | return this.http.post(URL + '/api/auth/signin/', credentials).toPromise(); | ||||
| } | } | ||||
| forgotPassword(email: string) { | |||||
| return this.http.post(URL + '/api/auth/forgot/', { email: email }).toPromise(); | |||||
| } | |||||
| 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(); | ||||
| } | } | ||||
| @@ -32,6 +32,7 @@ p { | |||||
| text-transform: none; | text-transform: none; | ||||
| outline: none; | outline: none; | ||||
| font-weight: 500; | font-weight: 500; | ||||
| text-decoration: none; | |||||
| } | } | ||||
| h1, | h1, | ||||
| h2, | h2, | ||||