Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Incorrect loginField Handling in Password Reset Request #574

Open
hangingman opened this issue Sep 11, 2024 · 0 comments
Open

Issue: Incorrect loginField Handling in Password Reset Request #574

hangingman opened this issue Sep 11, 2024 · 0 comments

Comments

@hangingman
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant