Menu

Learn Rails 8 by Building Study Flow, Part 2: Authentication with the Built-in Generator
πŸ“°

Learn Rails 8 by Building Study Flow, Part 2: Authentication with the Built-in Generator

DEV Community: rubyΒ·Shrouk AbozeidΒ·2 days ago
#GG1UMLju
#devtoruby#devto#dev#show#user
Reading 0:00
15s threshold

In Part 1 we generated a Rails 8 app and followed a request from route to controller. Today Study Flow gets its first real feature: users .

Before this Rails version, most people added a gem like Devise to get login. Rails 8 ships its own authentication generator . It writes plain Ruby code into your app, so you can read all of it, and that's exactly what we'll do.

What you'll learn

Running the Rails 8 authentication generator

What has_secure_password does for you

How a login works: the Session model, signed cookies and Current

How allow_unauthenticated_access and rate_limit protect your controllers

Adding a signup page, which the generator doesn't create, using params.expect

The idea in one minute

A website needs to remember who you are between requests, because HTTP forgets everything after each one.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.