You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/app/controllers/logins_controller.rb

28 lines
472 B
Ruby

class LoginsController < ApplicationController
def new; end
def create
email = params[:email].strip
if login_service.login(email)
redirect_to sent_login_path, flash: { email_recipient: email }
else
@invalid_email = true
render :new
end
end
def sent
@email_recipient = flash[:email_recipient]
redirect_to new_login_path unless @email_recipient
end
private
def login_service
EmailLoginService.new
end
end