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
1277fb20
Commit
1277fb20
authored
Aug 29, 2026
by
ThinhNC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: auth service with login, registration, token rotation, and session management
parent
73855b03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
auth.service.ts
src/modules/auth/auth.service.ts
+6
-2
No files found.
src/modules/auth/auth.service.ts
View file @
1277fb20
...
@@ -503,12 +503,16 @@ export class AuthService {
...
@@ -503,12 +503,16 @@ export class AuthService {
resolvedPhone
=
resolvedPhone
.
replace
(
/^
\+
84/
,
'0'
).
replace
(
/^84/
,
'0'
);
resolvedPhone
=
resolvedPhone
.
replace
(
/^
\+
84/
,
'0'
).
replace
(
/^84/
,
'0'
);
}
}
// Đảm bảo
có Zalo ID làm mã định danh
// Đảm bảo
luôn có Zalo ID làm mã định danh tài khoản
if
(
!
zaloId
)
{
if
(
!
zaloId
)
{
if
(
resolvedPhone
)
{
if
(
resolvedPhone
)
{
zaloId
=
`zalo_
${
resolvedPhone
}
`
;
zaloId
=
`zalo_
${
resolvedPhone
}
`
;
}
else
if
(
dto
.
phoneToken
)
{
const
tokenHash
=
crypto
.
createHash
(
'sha256'
).
update
(
dto
.
phoneToken
).
digest
(
'hex'
).
substring
(
0
,
16
);
zaloId
=
`zalo_tok_
${
tokenHash
}
`
;
}
else
{
}
else
{
throw
new
AppError
(
'Unable to identify Zalo user. Please grant basic permissions.'
,
400
,
ERROR_CODE
.
VALIDATION_ERROR
);
const
accHash
=
crypto
.
createHash
(
'sha256'
).
update
(
accessToken
).
digest
(
'hex'
).
substring
(
0
,
16
);
zaloId
=
`zalo_acc_
${
accHash
}
`
;
}
}
}
}
...
...
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