Class: LolAuth::UsersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/lol_auth/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#apple_signinObject


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/lol_auth/users_controller.rb', line 23

def 
  @manager = Apple::Login.new(params)

  @user = @manager.process()

  if @user.present?
    (:user, @user, store: false, bypass: true)

    response.headers.merge!(@manager.auth_header)

    render :success, status: 201
  else
    render :error, status: 422
  end
end

#facebook_signinObject


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/lol_auth/users_controller.rb', line 7

def 
	@manager = Facebook::Login.new()

   @user = @manager.(params[:token])

   if @user.present?
     (:user, @user, store: false, bypass: true)

 		response.headers.merge!(@manager.auth_header)

     render :success, status: 201
   else
     render :error, status: 422
   end
end

#google_signinObject


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/controllers/lol_auth/users_controller.rb', line 39

def 
  @manager = Google::Login.new(params)

  @user = @manager.process()

  if @user.present?
    (:user, @user, store: false, bypass: true)

    response.headers.merge!(@manager.auth_header)

    render :success, status: 201
  else
    render :error, status: 422
  end
end