Commit 7fe8d41d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve code style

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a61ccd4a
......@@ -8,7 +8,11 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
def create
@application = Doorkeeper::Application.new(application_params)
@application.owner = current_user if Doorkeeper.configuration.confirm_application_owner?
if Doorkeeper.configuration.confirm_application_owner?
@application.owner = current_user
end
if @application.save
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])
redirect_to oauth_application_url(@application)
......@@ -18,8 +22,10 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
end
def destroy
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :destroy]) if @application.destroy
if @application.destroy
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :destroy])
end
redirect_to profile_account_url
end
end
\ No newline at end of file
end
......@@ -27,9 +27,9 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
private
def matching_token?
Doorkeeper::AccessToken.matching_token_for pre_auth.client,
current_resource_owner.id,
pre_auth.scopes
Doorkeeper::AccessToken.matching_token_for(pre_auth.client,
current_resource_owner.id,
pre_auth.scopes)
end
def redirect_or_render(auth)
......@@ -41,7 +41,8 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
end
def pre_auth
@pre_auth ||= Doorkeeper::OAuth::PreAuthorization.new(Doorkeeper.configuration,
@pre_auth ||=
Doorkeeper::OAuth::PreAuthorization.new(Doorkeeper.configuration,
server.client_via_uid,
params)
end
......@@ -51,7 +52,7 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
end
def strategy
@strategy ||= server.authorization_request pre_auth.response_type
@strategy ||= server.authorization_request(pre_auth.response_type)
end
end
......@@ -2,7 +2,7 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
layout "profile"
def destroy
Doorkeeper::AccessToken.revoke_all_for params[:id], current_resource_owner
Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner)
redirect_to profile_account_url, notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy])
end
end
\ No newline at end of file
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment