-
Notifications
You must be signed in to change notification settings - Fork 181
Description
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:
angular-token/projects/angular-token/src/lib/angular-token.service.ts
Lines 415 to 418 in 62ecc83
| 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.