BigW Consortium Gitlab

authorizations_controller.rb 542 Bytes
Newer Older
Valery Sizov committed
1
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
2
  layout 'profile'
Valery Sizov committed
3

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