Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

account.PasswordResetSecrets.Any() is null when calling password reset #601

Open
Robban1980 opened this issue Jan 10, 2016 · 2 comments
Open
Labels

Comments

@Robban1980
Copy link

I am working on a flow where and administrator will create users by calling an API. The Administrator will not know the password and the users will have to set it through a password reset.

So when i call the API to create the user it works great, auto verifying the account with .SetConfirmedEmail method so that a password reset mail can be sent. In the same flow i call ResetPassword(email) when doing this in this flow right after the account was created i get a Null reference exception.

I found that there is a check in the ResetPassword(string tenant, string email) method in the UserAccountService.cs on line 1446 looking like this if (account.PasswordResetSecrets.Any()). In this flow i have built now the account.PasswordResetSecrets is always null causing the null reference exception.

If i instead redo the ResetPassword part manually then it works fine. Any idea on why it is null right after account creation but not the second time around?

@brockallen
Copy link
Owner

Not sure, but if you want write a unit test to reproduce it then we can get it fixed. Also, it might be just easier to send a PR that checks that for null.

@brockallen brockallen added the bug label Feb 22, 2016
@Robban1980
Copy link
Author

Will try to fix it an do a PR.

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

No branches or pull requests

2 participants