Class: AuthenticationsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
# File 'app/controllers/authentications_controller.rb', line 6

def create
  auth = request.env["omniauth.auth"]
  current_user.authentications.find_or_create_by_provider_and_uid(auth['provider'], auth['uid'])
  redirect_to authentications_url
end

#destroyObject



12
13
14
15
16
# File 'app/controllers/authentications_controller.rb', line 12

def destroy
  @authentication = current_user.authentications.find(params[:id])
  @authentication.destroy
  redirect_to authentications_url
end

#indexObject



2
3
4
# File 'app/controllers/authentications_controller.rb', line 2

def index
  @authentications = current_user.authentications if current_user
end