Skip to content

Commit

Permalink
Return proper unauthorized errors with code & resource
Browse files Browse the repository at this point in the history
  • Loading branch information
nid90 committed Aug 25, 2024
1 parent 4b7cf2c commit 0fc0600
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rack/app_store_auth_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ def call(env)
@app.call env
rescue Spaceship::WrapperToken::TokenExpiredError => e
env[RACK_LOGGER].error e
return_unauthorized_error({message: "Invalid auth token for apple store connect API"})
return_unauthorized_error(
{
message: "Invalid auth token for apple store connect API",
code: "unauthorized",
resource: "app_store_connect_api"
}
)
end
end
end

0 comments on commit 0fc0600

Please sign in to comment.