Monday 26 November 2018

Newbie help! Authentication strategy for storing data permanently in a database? And for different types of users?

Greetings!First, I'm very much a junior dev, but this is a great opportunity for me to learn and build something fun.I'm working on an app which, in essence, allows consumers to log in and favorite things they like, and store those things to the database. In other words, authentication can't just be a temporary token thing that'll expire and reset their favorites. Once the user clicks to favorite the item, it needs to go to the database and stay there, and the database needs to recognize them every time they log in. The only other things I might need to store are basic, like an email address and a city/state.I also need to create a login for producers, where they can post and edit the entries (which the users can then favorite). Like the consumers, the producers' posts need to be stored in a database and persist forever (unless they choose to edit it).They need to be completely separate -- meaning, consumers shouldn't have the functionality of producers (they shouldn't be able to post/edit items), and producers shouldn't have the functionality of consumers (they shouldn't be able to favorite things).If you were in my shoes, what would you use to authenticate these producers/consumers? This is my first time ever really messing with authentication, so I'm more than a little lost. I don't see how something like a temporary token is going to help with long-term data storage, so what program/strategy would you use to create those separate logins? Something like Passport?(This might be a really stupid question, but authentication is mind-boggling.)If it matters, I'm using React/Redux/Express/Node/MySQL.Thanks in advance!

Submitted November 27, 2018 at 12:38AM by PalmettoSpur

No comments:

Post a Comment