Class: ActionAuth::RegistrationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/action_auth/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/action_auth/registrations_controller.rb', line 9

def create
  @user = User.new(user_params)

  if @user.save
    if ActionAuth.configuration.
      send_email_verification
      redirect_to , notice: "Welcome! You have signed up successfully. Please check your email to verify your account."
    else
      session_record = @user.sessions.create!
      cookies.signed.permanent[:session_token] = { value: session_record.id, httponly: true }

      redirect_to , notice: "Welcome! You have signed up successfully"
    end
  else
    render :new, status: :unprocessable_entity
  end
end

#newObject



5
6
7
# File 'app/controllers/action_auth/registrations_controller.rb', line 5

def new
  @user = User.new
end