Skip to content

Commit 0744225

Browse files
authored
docs: Clarify user lockout when setting empty ACL (#10174)
1 parent 3da580a commit 0744225

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/Options/Definitions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports.SchemaOptions = {
5454
module.exports.ParseServerOptions = {
5555
accountLockout: {
5656
env: 'PARSE_SERVER_ACCOUNT_LOCKOUT',
57-
help: 'The account lockout policy for failed login attempts.',
57+
help: "The account lockout policy for failed login attempts.<br><br>Note: Setting a user's ACL to an empty object `{}` via master key is a separate mechanism that only prevents new logins; it does not invalidate existing session tokens. To immediately revoke a user's access, destroy their sessions via master key in addition to setting the ACL.",
5858
action: parsers.objectParser,
5959
type: 'AccountLockoutOptions',
6060
},

src/Options/docs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Options/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ export interface ParseServerOptions {
251251
| boolean
252252
| (SendEmailVerificationRequest => boolean | Promise<boolean>)
253253
);
254-
/* The account lockout policy for failed login attempts. */
254+
/* The account lockout policy for failed login attempts.
255+
<br><br>
256+
Note: Setting a user's ACL to an empty object `{}` via master key is a separate mechanism that only prevents new logins; it does not invalidate existing session tokens. To immediately revoke a user's access, destroy their sessions via master key in addition to setting the ACL. */
255257
accountLockout: ?AccountLockoutOptions;
256258
/* The password policy for enforcing password related rules. */
257259
passwordPolicy: ?PasswordPolicyOptions;

src/Routers/UsersRouter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ export class UsersRouter extends ClassesRouter {
132132
if (!isValidPassword) {
133133
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Invalid username/password.');
134134
}
135-
// Ensure the user isn't locked out
136-
// A locked out user won't be able to login
137-
// To lock a user out, just set the ACL to `masterKey` only ({}).
138-
// Empty ACL is OK
135+
// A user with an empty ACL (master key only) is considered locked out and
136+
// cannot log in. This only prevents new logins; existing session tokens
137+
// remain valid. To immediately revoke access, also destroy the user's
138+
// sessions via master key.
139139
if (!req.auth.isMaster && user.ACL && Object.keys(user.ACL).length == 0) {
140140
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Invalid username/password.');
141141
}

0 commit comments

Comments
 (0)