Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
hdastageeri
hft_awado_app
Commits
fee6d9ec
Commit
fee6d9ec
authored
Jan 06, 2020
by
Priyanka Upadhye
Browse files
commit reset password changes
parent
63f87f70
Changes
6
Show whitespace changes
Inline
Side-by-side
src/app/auth/reset-password/reset-password-routing.module.ts
0 → 100644
View file @
fee6d9ec
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
Routes
,
RouterModule
}
from
'
@angular/router
'
;
import
{
ResetPasswordPage
}
from
'
./reset-password.page
'
;
const
routes
:
Routes
=
[
{
path
:
''
,
component
:
ResetPasswordPage
}
];
@
NgModule
({
imports
:
[
RouterModule
.
forChild
(
routes
)],
exports
:
[
RouterModule
],
})
export
class
ResetPasswordPageRoutingModule
{}
src/app/auth/reset-password/reset-password.module.ts
0 → 100644
View file @
fee6d9ec
import
{
NgModule
}
from
'
@angular/core
'
;
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
FormsModule
}
from
'
@angular/forms
'
;
import
{
IonicModule
}
from
'
@ionic/angular
'
;
import
{
ResetPasswordPageRoutingModule
}
from
'
./reset-password-routing.module
'
;
import
{
ResetPasswordPage
}
from
'
./reset-password.page
'
;
@
NgModule
({
imports
:
[
CommonModule
,
FormsModule
,
IonicModule
,
ResetPasswordPageRoutingModule
],
declarations
:
[
ResetPasswordPage
]
})
export
class
ResetPasswordPageModule
{}
src/app/auth/reset-password/reset-password.page.html
0 → 100644
View file @
fee6d9ec
<ion-header>
<ion-toolbar>
<ion-title>
Reset Password
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-grid>
<ion-row
justify-content-center
>
<ion-col
align-self-center
size-md=
"6"
size-lg=
"5"
size-xs=
"12"
>
<div
padding
>
<img
src=
"../../../assets/images/bike2gologo.png"
>
</div>
<div
class=
"ion-text"
>
<h3>
Reset Password
</h3>
</div>
<ion-item
><ion-input
type=
"text"
[value]=
"username"
disabled=
"true"
></ion-input></ion-item>
<ion-item
><ion-input
type=
"password"
[(ngModel)]=
"oldPassword"
placeholder=
"Old Password"
></ion-input></ion-item>
<ion-item
><ion-input
type=
"password"
[(ngModel)]=
"newPassword"
placeholder=
"New Password"
></ion-input></ion-item>
<ion-item
><ion-input
type=
"password"
[(ngModel)]=
"confirmPassword"
placeholder=
"Confirm Password"
></ion-input></ion-item>
<div
padding
>
<ion-button
size=
"large"
expand=
"block"
(click)=
"resetPassword()"
>
Reset Password
</ion-button>
</div>
<div
padding
>
<ion-button
size=
"large"
expand=
"block"
(click)=
"login()"
>
Login
</ion-button>
</div>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
\ No newline at end of file
src/app/auth/reset-password/reset-password.page.scss
0 → 100644
View file @
fee6d9ec
src/app/auth/reset-password/reset-password.page.spec.ts
0 → 100644
View file @
fee6d9ec
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
IonicModule
}
from
'
@ionic/angular
'
;
import
{
ResetPasswordPage
}
from
'
./reset-password.page
'
;
describe
(
'
ResetPasswordPage
'
,
()
=>
{
let
component
:
ResetPasswordPage
;
let
fixture
:
ComponentFixture
<
ResetPasswordPage
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
ResetPasswordPage
],
imports
:
[
IonicModule
.
forRoot
()]
}).
compileComponents
();
fixture
=
TestBed
.
createComponent
(
ResetPasswordPage
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
}));
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/auth/reset-password/reset-password.page.ts
0 → 100644
View file @
fee6d9ec
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
HttpClient
,
HttpHeaders
}
from
'
@angular/common/http
'
;
import
{
Observable
}
from
'
rxjs
'
;
import
{
Storage
}
from
'
@ionic/storage
'
;
import
{
ToastService
}
from
'
../../services/toast.service
'
;
import
{
UserService
}
from
'
../../services/user.service
'
;
import
{
RestService
}
from
'
../../rest.service
'
;
@
Component
({
selector
:
'
app-reset-password
'
,
templateUrl
:
'
./reset-password.page.html
'
,
styleUrls
:
[
'
./reset-password.page.scss
'
],
})
export
class
ResetPasswordPage
implements
OnInit
{
oldPassword
=
""
;
newPassword
=
""
;
confirmPassword
=
""
;
username
=
""
;
ResetPasswordApi
:
Observable
<
any
>
;
constructor
(
private
router
:
Router
,
public
httpClient
:
HttpClient
,
private
toastService
:
ToastService
,
public
restService
:
RestService
,
private
storage
:
Storage
,
public
userService
:
UserService
)
{
this
.
username
=
this
.
userService
.
getUsername
();}
ngOnInit
()
{
}
login
(){
this
.
router
.
navigateByUrl
(
'
/login
'
);
}
resetPassword
(){
if
(
this
.
confirmPassword
!=
this
.
newPassword
)
this
.
toastService
.
showToast
(
"
Please Confirm Password Again
"
);
else
{
this
.
storage
.
get
(
'
token
'
).
then
((
token
)
=>
{
let
url
=
'
http://193.196.52.237:8081/password-reset/
'
const
headers
=
new
HttpHeaders
().
set
(
"
Authorization
"
,
"
Bearer
"
+
token
);
this
.
ResetPasswordApi
=
this
.
httpClient
.
post
<
any
>
(
url
,
{
"
oldPassword
"
:
this
.
oldPassword
,
"
newPassword
"
:
this
.
newPassword
},{
headers
});
this
.
ResetPasswordApi
.
subscribe
((
resp
)
=>
{
console
.
log
(
"
PasswordChanged
"
,
resp
);
this
.
toastService
.
showToast
(
"
Password Changed Sucessfully!Login Again
"
);
this
.
router
.
navigateByUrl
(
'
/login
'
);
},
(
error
)
=>
{
console
.
log
(
error
)
//this.loadingService.hideLoader();
this
.
toastService
.
showToast
(
"
Please Try Again
"
);
});
});
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment