Class: Searls::Auth::RegistrationsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/searls/auth/registrations_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#forwardable_params

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/searls/auth/registrations_controller.rb', line 8

def create
  result = CreatesUser.new.call(params)

  if result.success?
    user = result.user
    if password_registration?
      handle_password_registration(user)
    else
      handle_email_registration(user)
    end
  else
    flash.now[:alert] = Searls::Auth.config.resolve(:flash_error_after_register_attempt, result.error_messages, searls_auth.(email: params[:email], **forwardable_params), params)
    render Searls::Auth.config.register_view, layout: Searls::Auth.config.layout, status: :unprocessable_content
  end
end

#pending_email_verificationObject



24
25
26
# File 'app/controllers/searls/auth/registrations_controller.rb', line 24

def pending_email_verification
  render Searls::Auth.config.pending_email_verification_view, layout: Searls::Auth.config.layout
end

#showObject



4
5
6
# File 'app/controllers/searls/auth/registrations_controller.rb', line 4

def show
  render Searls::Auth.config.register_view, layout: Searls::Auth.config.layout
end