Provide support for API endpoint for login

Created on 3 February 2025, 2 months ago

Problem/Motivation

The module does not interact with the REST endpoint for login /user/login?_format=json but just with the regular Drupal facing forms.
This is an issue when Drupal uses decoupled for login.

Steps to reproduce

1. Install and enable the module (any version)
2. Enable the module REST and use the login endpoint (see it above)
3. It will bypass the authorization which is not good.

Proposed resolution

1. The REST login endpoint should also pass the same validation as regular login forms.
2. The validation response should be followed as a message and a JSON response with the code 403.

{
    "error": "john.doe is not recognized as a username or email to this site."
}

Remaining tasks

Write a proper patch for the mentioned issue.

User interface changes

None.

API changes

Yes.

Data model changes

None.

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇲🇩Moldova andrei.vesterli Chisinau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024