Class: User::SignInsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/user/sign_ins_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
# File 'app/controllers/user/sign_ins_controller.rb', line 11

def create
  @sign_in = .new().(Identities::Email)

   @sign_in
end

#destroyObject



30
31
32
33
# File 'app/controllers/user/sign_ins_controller.rb', line 30

def destroy
  session_manager.sign_out
  redirect_to root_url, notice: t('.success')
end

#newObject



6
7
8
9
# File 'app/controllers/user/sign_ins_controller.rb', line 6

def new
  session_manager.sign_out
  @sign_in = .new()
end

#oauth_callbackObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/user/sign_ins_controller.rb', line 17

def oauth_callback
  # TODO: do I need to check the provider param? There is on in oauth_data
  # and one in params.
  oauth_data = request.env["omniauth.auth"]
  oauth_error = request.env["omniauth.error"]

  # TODO: The host app should be able to do a sign_up here instead 
  @sign_in = .new(oauth_data: oauth_data,
                        oauth_error: oauth_error).(Identities::OAuth)

   @sign_in
end