Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement email login flow #1183

Closed
wants to merge 1 commit into from
Closed

[WIP] Implement email login flow #1183

wants to merge 1 commit into from

Conversation

jamalx31
Copy link

@langpavel

Need help to move forward with this:
1- not sure how to connect this with Passport
2- if I added username/password in the right place
3- if bcrypt is needed in the first place

@jamalx31 jamalx31 changed the title Implement email login flow WIP: Implement email login flow Mar 19, 2017
@jamalx31 jamalx31 changed the title WIP: Implement email login flow [WIP] Implement email login flow Mar 19, 2017
@langpavel
Copy link
Collaborator

Hi, personally I don't use passport. I created my own password login flow in private project but I'm not sure if way I do it is right. But it works for me and I can describe how it works.

At first, you need endpoint for login. I integrated this into GraphQL as mutation but I see more often now that doing this as simple REST can be less hacky, simpler and maintainable.

Then if request succeed you can set HTTP-only cookie. You can do this in GraphQL too but it feels .. well.. not so nice..

I'm using JWT in cookie which have ACL array of strings.

If user is authenticated, JWT is parsed on server and ACL is serialized to redux store. Then I have ACL React component which provide ACL instance to it's child. So everything can be handled declaratively

@piglovesyou
Copy link
Collaborator

As one of sample cases, my project uses passport-local for local DB authentication, which is very common way for local DB auth in Node.js I could say and is very good fit to RSK-base project, since passport-facebook is already in. I think it's a good idea to integrate passport-local impl in master to make email-auth work out of the box.

@jamalx31 jamalx31 closed this Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants