Class: Doorkeeper::AuthorizationsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
# File 'app/controllers/doorkeeper/authorizations_controller.rb', line 15

def create
  redirect_or_render(authorize_response)
end

#destroyObject



19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/doorkeeper/authorizations_controller.rb', line 19

def destroy
  redirect_or_render(authorization.deny)
rescue Doorkeeper::Errors::InvalidTokenStrategy => e
  error_response = get_error_response_from_exception(e)

  if Doorkeeper.configuration.api_only
    render json: error_response.body, status: :bad_request
  else
    render :error, locals: { error_response: error_response }
  end
end

#newObject



7
8
9
10
11
12
13
# File 'app/controllers/doorkeeper/authorizations_controller.rb', line 7

def new
  if pre_auth.authorizable?
    render_success
  else
    render_error
  end
end