phoenix_token_auth icon indicating copy to clipboard operation
phoenix_token_auth copied to clipboard

blank hashed password in case of errors in the changeset

Open plu9in opened this issue 9 years ago • 2 comments

In https://github.com/manukall/phoenix_token_auth/blob/master/lib/phoenix_token_auth/registrator.ex , line 34,

def set_hashed_password(changeset = %{errors: [_]}), do: changeset

will not match in case of several errors. So, if the changeset has several errors, the hashed password will be returned.

A correction would be : def set_hashed_password(changeset = %{errors: [ _ | _ ]}), do: changeset

plu9in avatar Jan 04 '16 09:01 plu9in

thanks for the bug report. you're absolutely right. would you want to fix that problem? i'd happily accept a PR.

manukall avatar Jan 04 '16 10:01 manukall

You are welcome but it is nothing compared to your library. It is a great job.

I have fixed it and done a PR.

plu9in avatar Jan 04 '16 11:01 plu9in