Class: Doorkeeper::AuthorizationsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/doorkeeper/authorizations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

TODO: Handle raise invalid authorization


19
20
21
# File 'app/controllers/doorkeeper/authorizations_controller.rb', line 19

def create
  redirect_or_render authorization.authorize
end

#destroyObject


23
24
25
# File 'app/controllers/doorkeeper/authorizations_controller.rb', line 23

def destroy
  redirect_or_render authorization.deny
end

#newObject


5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/doorkeeper/authorizations_controller.rb', line 5

def new
  if pre_auth.authorizable?
    if skip_authorization? || matching_token?
      auth = authorization.authorize
      redirect_to auth.redirect_uri
    else
      render :new
    end
  else
    render :error
  end
end