manukall / phoenix_token_auth

Token authentication solution for Phoenix. Useful for APIs for e.g. single page apps.
MIT License
163 stars 39 forks source link

blank hashed password in case of errors in the changeset #52

Open plu9in opened 8 years ago

plu9in commented 8 years ago

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

def set_hashedpassword(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_hashedpassword(changeset = %{errors: [ | _ ]}), do: changeset

manukall commented 8 years ago

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

plu9in commented 8 years ago

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

I have fixed it and done a PR.