authorizations_controller.rb 574 Bytes
Newer Older
1
2
# frozen_string_literal: true

Valery Sizov's avatar
Valery Sizov committed
3
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
4
  layout 'profile'
Valery Sizov's avatar
Valery Sizov committed
5

6
  # Overridden from Doorkeeper::AuthorizationsController to
7
  # include the call to session.delete
Valery Sizov's avatar
Valery Sizov committed
8
9
10
11
  def new
    if pre_auth.authorizable?
      if skip_authorization? || matching_token?
        auth = authorization.authorize
12
        session.delete(:user_return_to)
Valery Sizov's avatar
Valery Sizov committed
13
14
15
16
17
18
19
20
21
        redirect_to auth.redirect_uri
      else
        render "doorkeeper/authorizations/new"
      end
    else
      render "doorkeeper/authorizations/error"
    end
  end
end