Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
b9fb17d4
Unverified
Commit
b9fb17d4
authored
Aug 29, 2024
by
Nicolas Giard
Committed by
GitHub
Aug 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: prevent password reset on disabled account
parent
d1b4c8c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
users.js
server/models/users.js
+7
-0
No files found.
server/models/users.js
View file @
b9fb17d4
...
...
@@ -499,6 +499,10 @@ module.exports = class User extends Model {
})
if
(
usr
)
{
if
(
!
usr
.
isActive
)
{
throw
new
WIKI
.
Error
.
AuthAccountBanned
()
}
await
WIKI
.
models
.
users
.
query
().
patch
({
password
:
newPassword
,
mustChangePwd
:
false
...
...
@@ -527,6 +531,9 @@ module.exports = class User extends Model {
if
(
!
usr
)
{
WIKI
.
logger
.
debug
(
`Password reset attempt on nonexistant local account
${
email
}
: [DISCARDED]`
)
return
}
else
if
(
!
usr
.
isActive
)
{
WIKI
.
logger
.
debug
(
`Password reset attempt on disabled local account
${
email
}
: [DISCARDED]`
)
return
}
const
resetToken
=
await
WIKI
.
models
.
userKeys
.
generateToken
({
userId
:
usr
.
id
,
...
...
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