Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finwise-miniapp-be
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
ThinhNC
finwise-miniapp-be
Commits
228e2506
Commit
228e2506
authored
Aug 29, 2026
by
ThinhNC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: authentication service with JWT handling, device tracking, and user profile management
parent
5c0b7946
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
auth.service.ts
src/modules/auth/auth.service.ts
+10
-4
No files found.
src/modules/auth/auth.service.ts
View file @
228e2506
...
...
@@ -456,9 +456,10 @@ export class AuthService {
.
digest
(
'hex'
);
const
zaloProfile
=
await
this
.
fetchZaloProfile
(
accessToken
,
appsecretProof
);
if
(
!
zaloProfile
||
zaloProfile
.
error
!==
0
)
{
if
(
!
zaloProfile
||
(
zaloProfile
.
error
!==
undefined
&&
zaloProfile
.
error
!==
0
)
||
!
zaloProfile
.
id
)
{
console
.
error
(
'[ZaloAuth] fetchZaloProfile failed:'
,
zaloProfile
);
throw
new
AppError
(
'Invalid Zalo access token or Zalo API error
'
,
zaloProfile
?.
message
?
`Zalo Profile Error:
${
zaloProfile
.
message
}
`
:
'Invalid Zalo access token
'
,
401
,
ERROR_CODE
.
INVALID_CREDENTIALS
,
);
...
...
@@ -472,9 +473,14 @@ export class AuthService {
if
(
dto
.
phoneToken
)
{
const
phoneResponse
=
await
this
.
fetchZaloPhoneNumber
(
accessToken
,
dto
.
phoneToken
,
appSecret
);
if
(
!
phoneResponse
||
phoneResponse
.
error
!==
0
||
!
phoneResponse
.
data
?.
number
)
{
if
(
!
phoneResponse
||
(
phoneResponse
.
error
!==
undefined
&&
phoneResponse
.
error
!==
0
)
||
!
phoneResponse
.
data
?.
number
)
{
console
.
error
(
'[ZaloAuth] fetchZaloPhoneNumber failed:'
,
phoneResponse
);
throw
new
AppError
(
phoneResponse
?.
message
||
'Failed to decode phone number from Zalo token'
,
phoneResponse
?.
message
?
`Zalo Phone Error:
${
phoneResponse
.
message
}
`
:
'Failed to decode phone number from Zalo token'
,
401
,
ERROR_CODE
.
INVALID_CREDENTIALS
,
);
...
...
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