Skip to content

The beforeLogin hook will not be triggered when attempting to log in with an incorrect password. #9614

@tooodooo

Description

@tooodooo

New Issue Checklist

Issue Description

I want to use beforeLogin to implement the functionality of locking a user's account for 10 minutes if the number of login failures exceeds 3 times. However, the beforeLogin hook is not triggered when the password is incorrect, and it is triggered successfully only when the password is correct.

Steps to reproduce

The beforeLogin hook will not be triggered when attempting to log in with an incorrect password.

Actual Outcome

{ "code": 101, "error": "Invalid username/password." }

Expected Outcome

beforeLogin should be triggered!?

Environment

docker with cloud code support

Server

  • Parse Server version: 7.3.0
  • Operating system: MacOS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: lastest
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Flutter
  • SDK version: 9.0.0

Logs

[1] parse-server running on http://localhost:1337/parse
error: Invalid username/password. {"code":101,"stack":"Error: Invalid username/password.\n at /parse-server/lib/Routers/UsersRouter.js:135:17"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions