Skip to content

Issue: Incorrect loginField Handling in Password Reset Request #574

@hangingman

Description

@hangingman

Description:

There appears to be a bug in the angular-token library regarding the handling of the loginField parameter during the password reset request. In the current implementation:

const body = {
[this.options.loginField]: resetPasswordData.login,
redirect_url: this.options.resetPasswordCallback
};

The loginField option is used to dynamically set the key for the login credential in the request body. While this approach works for normal login requests, it causes issues during password reset requests.

Problem:

Devise, which angular-token typically integrates with, expects the email to be provided in the email parameter during password reset. However, if this.options.loginField is set to a value other than "email" (e.g., "username"), the password reset request will fail because Devise does not recognize the custom parameter name.

Proposed Solution:

The library should override the loginField option and enforce the use of "email" as the key in the password reset request body, regardless of the value set in this.options.loginField. This would align the implementation with Devise's expectations and prevent potential issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions