Class: User::SignUpsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
# File 'app/controllers/user/sign_ups_controller.rb', line 10

def create
  @sign_up = SignUp.new().(Identities::Email)

   @sign_up
end

#newObject



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

def new
  @sign_up = SignUp.new
end

#oauth_callbackObject



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

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"]

  # FIXME: the way the user_name is inferred might work for facebook only
  oauth_params = {oauth_data: oauth_data,
                  user_name: oauth_data[:info][:nickname]}
  # TODO: The host app should be able to do a sign_up here instead 
  @sign_up = SignUp.new(oauth_params).(Identities::OAuth)

   @sign_up
end