Open trvslhlt opened 3 years ago
After reading the article I'm not sure what I need to do in means of creating things on the frontend. I'm assuming that I need a form that will make a post request to the api and populate a database. Do we just need to decide what the params look like? This feels like I'm not thinking of something.
@tuna42na I'm working on some slides that show how we can adapt the tutorial's approach for react + rails. Will try to share that today.
This pair of blog posts may be helpful:
The first is very similar to what Travis sent, but also includes use of JWT. The second post is all about setting up the React side of things to work with the Rails API.
Here is the PR for basic authentication on the backend. I generally followed the first of the blog posts I mentioned yesterday, but diverged in a few places where the code in the blog post was broken or did problematic things, like sending the user's password_digest back to the frontend whenever we rendered a JSON representation of the user.
The blog post was still a helpful first start, so hopefully it will be useful on the frontend as well as a good starting place for authentication.
We want users to have accounts for a number of reasons. First they should be able to save their name selections. Second they should be able to share their selections with others. Before we can offer either of these features we need to introduce accounts to baby-namr. I propose we adapt this rails tutorial for our use case: https://levelup.gitconnected.com/simple-authentication-guide-with-ruby-on-rails-16a6255f0be8