Module: Hello::Concerns::Registration::SignUp

Included in:
Registration::SignUpController
Defined in:
app/controllers/hello/concerns/registration/sign_up.rb

Instance Method Summary collapse

Instance Method Details

#on_failureObject



18
19
20
21
22
23
# File 'app/controllers/hello/concerns/registration/sign_up.rb', line 18

def on_failure
  respond_to do |format|
    format.html {  }
    format.json { render json: @sign_up.errors, status: :unprocessable_entity }
  end
end

#on_successObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/hello/concerns/registration/sign_up.rb', line 6

def on_success
  deliver_welcome_email
  deliver_confirmation_email

  access_token = sign_in!(@sign_up.user, expires_at, sudo_mode_expires_at)

  respond_to do |format|
    format.html { redirect_to path_to_go }
    format.json { render json: access_token.as_json_web_api, status: :created }
  end
end