Class: Magics::RequestsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Magics::RequestsController
- Defined in:
- app/controllers/action_auth/magics/requests_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/action_auth/magics/requests_controller.rb', line 6 def create user = User.find_or_initialize_by(email: params[:email]) if user.new_record? password = SecureRandom.hex(32) user.password = password user.password_confirmation = password user.save! end UserMailer.with(user: user).magic_link.deliver_later redirect_to sign_in_path, notice: "Check your email for a magic link." end |
#new ⇒ Object
3 4 |
# File 'app/controllers/action_auth/magics/requests_controller.rb', line 3 def new end |