Skip to content

Fix oauth token endpoint invalid credentials on tenant #2691

Ben requested to merge fix/tenant-oauth-resp-2691 into master

Ticket(s) / Related Merge Requests

#2691 (closed)

Summary of Changes

Fixes issue with oauth token endpoint where-in during user retrieval if a user is not found by its index (username), we try to call getGuid() on the null object, causing a 500 error.

Testing Considerations

Bound to https://ben.oke.minds.io/api/v3/oauth/token

Test that the below returns an invalid credentials exception, not a 500:

curl -i -X POST -H "Content-Type: application/json" -d '{"grant_type": "password", "client_id": "mobile", "password": "bla", "username":"minds213123"}' https://ben.oke.minds.io/api/v3/oauth/token

For staging testing replace the domain above with an actual tenant domain, and so long as the user doesn't exist on the network it should work.

Deployment Considerations

Standard deployment.

Regression Scope

Users repository change, should be safe as it just adds a conditional check that the user is present.

Platform Affected (web, mobile, etc)

Engine.

Developer Testing Completed

Manual, unit (phpspec).

Screenshots / Screen Recording

image

Does this impact

  • Localization
  • Dark/light mode
  • Guest mode

Definition of Done Checklist

  • The Acceptance Criteria has been met
  • Code is tested: Testing includes unit/spec, E2E/automated and manual testing
  • Merge requests description has been filled out
Edited by Ben

Merge request reports