App Academy: Week 8, Day 4
Today we finally learned how to implement authentication using React and API controllers in Rails. So, I spent a good amount of time today reconfiguring my app to do authentication through React rather than through the old html.erb view that I had written.
Doing authentication with React is huge for my app--it now allows me to get the current user from the SessionStore in any React component where I need to know who the current user is. For instance, today I worked a lot on impleminting "likes" for posts, for which my component needs to know whether or not the current user has already liked the post in question. Without React auth, it would be incredibly burdensome to figure out who the current user is in cases like this.
In addition, I learned just how important it is to pay attention to the asynchronicity of Ajax requests today when implementing likes--I feel like I really have it down now.