mxstbr / login-flow

:key: A login/register flow built with React&Redux
https://loginflow.mxstbr.com
MIT License
1.6k stars 215 forks source link

Encrypt password on the frontend before sending the request. Closes #2 #7

Closed geakstr closed 8 years ago

geakstr commented 8 years ago

Encrypt user password with bcrypt and send this to server while login/register

Included new function ./js/utils/salt.js for generate static salt by seed. Uses for generating salt by username

mxstbr commented 8 years ago

Thanks so much, I'll take a look soon!

geakstr commented 8 years ago

I think demo will stop working, because users localstorage will contain unencrypted passwords

mxstbr commented 8 years ago

Oh yeah actually, that might happen. What could we do to circumvent that?

mxstbr commented 8 years ago

I just tried it, and indeed as expected, previously registered password don't work. (e.g. the default username/password combination throws a "wrong password" error)

Any ideas how we could work around that?

geakstr commented 8 years ago

I don't see a good solution. Maybe set flag in localstorage: if flag not exist — clear storage. Or move from localstorage to in-memory storage.

mxstbr commented 8 years ago

Yeah, a flag might be a good way to go. Would you mind adding that?

geakstr commented 8 years ago

Ok, I'll do it :)

mxstbr commented 8 years ago

I just merged #6 and now we have some conflicts, would you mind resolving them? :+1:

geakstr commented 8 years ago

@mxstbr fixed

mxstbr commented 8 years ago

Thanks for the great PR, much appreciated!

geakstr commented 8 years ago

Very nice!