Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
myAppraisal
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
myAppraisal
Commits
5ba477dd
Commit
5ba477dd
authored
Feb 19, 2025
by
Nakarin Luankla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เพิ่ม refreshToken
parent
aaaf6be8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
login-page.component.ts
src/app/authentication/login-page/login-page.component.ts
+1
-0
auth.service.ts
src/app/shared/services/auth.service.ts
+2
-2
No files found.
src/app/authentication/login-page/login-page.component.ts
View file @
5ba477dd
...
@@ -120,6 +120,7 @@ export class LoginPageComponent {
...
@@ -120,6 +120,7 @@ export class LoginPageComponent {
this
.
loginForm
.
controls
[
'password'
].
value
).
subscribe
({
this
.
loginForm
.
controls
[
'password'
].
value
).
subscribe
({
next
:
response
=>
{
next
:
response
=>
{
sessionStorage
.
setItem
(
"accessToken"
,
response
.
accessToken
)
sessionStorage
.
setItem
(
"accessToken"
,
response
.
accessToken
)
sessionStorage
.
setItem
(
"refreshToken"
,
response
.
refreshToken
)
this
.
router
.
navigate
([
'/self-evaluation'
]);
this
.
router
.
navigate
([
'/self-evaluation'
]);
},
error
:
error
=>
{
},
error
:
error
=>
{
this
.
error
=
'Please check email and passowrd'
;
this
.
error
=
'Please check email and passowrd'
;
...
...
src/app/shared/services/auth.service.ts
View file @
5ba477dd
...
@@ -82,12 +82,12 @@ export class AuthService {
...
@@ -82,12 +82,12 @@ export class AuthService {
loginWithUserPass
(
username
:
string
,
password
:
string
):
Observable
<
{
accessToken
:
string
}
>
{
loginWithUserPass
(
username
:
string
,
password
:
string
):
Observable
<
{
accessToken
:
string
,
refreshToken
:
string
}
>
{
const
body
=
{
const
body
=
{
username
:
username
,
username
:
username
,
password
:
password
password
:
password
}
}
return
this
.
http
.
post
<
{
accessToken
:
string
}
>
(
this
.
urlApi
+
"/login"
,
body
)
return
this
.
http
.
post
<
{
accessToken
:
string
,
refreshToken
:
string
}
>
(
this
.
urlApi
+
"/login"
,
body
)
}
}
logout
(){
logout
(){
sessionStorage
.
clear
()
sessionStorage
.
clear
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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