diff --git a/app/controllers/device_authorizations_controller.rb b/app/controllers/device_authorizations_controller.rb index 8b68d9b..f4857de 100644 --- a/app/controllers/device_authorizations_controller.rb +++ b/app/controllers/device_authorizations_controller.rb @@ -7,8 +7,13 @@ def index def approve session[:device_grant_id] = nil device_grant = device_grant_model.lock.find_by(user_code: user_code) - authorization_error_response(:invalid_user_code); return if device_grant.nil? # standard:disable Style/Semicolon - authorization_error_response(:expired_user_code); return if device_grant.expired? # standard:disable Style/Semicolon + if device_grant.nil? + authorization_error_response(:invalid_user_code) + return + end + if device_grant.expired? + authorization_error_response(:expired_user_code) + end session[:device_grant_id] = device_grant.id @client = Doorkeeper::Application.find_by(id: device_grant.application_id)