Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
reesericci committed Jan 28, 2024
1 parent 9c2e629 commit f8f2b48
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/device_authorizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f8f2b48

Please sign in to comment.