Using Passwordless Login

This is a premium course, which you can purchase below.

Buy Now

I don't like storing passwords, even if they're hashed. You don't like remembering them, so let's setup a simple email link system.


We could probably write this ourselves, but I've used the the devise-passwordless gem before and it works really well. Setting it up is a matter of following the instructions on the GitHub page, but make sure you also setup your mail settings as shown in the video:

  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
  config.action_mailer.perform_caching = false
  config.action_mailer.smtp_settings = {
    address: ENV['AWS_SES_HOST'],
    user_name: ENV['AWS_SES_USER'],
    password: ENV['AWS_SES_PASS'],
  }

You want to be sure you see any errors on send, so make sure that's enabled. Also: be sure to use Rails secrets or environment settings as I'm doing here.