rails api

JWT Storage in Rails + React The Right Way

Local or session storage in the browser might feel like the right place to store a JWT when authenticating your client-side app against a backend API. Maybe it feels like the right place because I told you to do that. But its not right! Its wrong and its insecure. Instead,…

Rails API Painless Error Handling and Rendering

Are you sick and tired of handling endless exceptions, writing custom logic to handle bad API requests and serializing the same errors over and over? What if I told you there was a way to abstract away messy and repetitive error raising and response rendering in your Rails API? A…

Trello API Webhooks + Rails: Receiving Payloads with Custom Middleware

Trello is a hugely popular project organization tool, and my team uses it every day to plan development projects, lessons for our students and more. However, if you're like me, it doesn't matter how many lists you make if you then forget to look at the list and do the…

Building a Super Simple Rails API, JSON API Edition

In an earlier post, we built a super quick and super simple Rails API using the Active Model Serializer gem and the Active Model Adapter. There's been a lot of growth lately, however, around JSON API. What is JSON API? So, what is JSON API and what's so great about…

JWT Auth in Rails, From Scratch

In an earlier post, we took a look at JWT authentication in Rails, and implemented a JWT authentication system using the Knock gem. Here, we'll drop down a level and re-build our JWT authentication system from scratch, without the help of the Knock gem. You can check out the code…