Page MenuHomePhorge

Don't call userResponse() on failed login
ClosedPublic

Authored by machniak on Feb 3 2022, 3:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 3:51 PM
Unknown Object (File)
Thu, Apr 18, 3:26 PM
Unknown Object (File)
Tue, Apr 9, 5:09 PM
Unknown Object (File)
Tue, Apr 9, 12:20 AM
Unknown Object (File)
Mon, Apr 1, 5:38 PM
Unknown Object (File)
Fri, Mar 29, 6:31 PM
Unknown Object (File)
Fri, Mar 29, 9:59 AM
Unknown Object (File)
Mar 18 2024, 2:57 PM
Subscribers
Restricted Project

Details

Reviewers
mollekopf
Group Reviewers
Restricted Project
Commits
rK60f8cfed258b: Don't call userResponse() on failed login
Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Branch
dev/fix-redundant-user-response
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 38239
Build 15463: arc lint + arc unit

Event Timeline

machniak created this revision.
mollekopf added inline comments.
src/app/Http/Controllers/API/AuthController.php
172

If the idea is that we don't call userResponse if the $user == null in a failed login case, should we then not also not set the status to 'success' ?
I could be on the wrong track because I don't really recall how exactly this is being called in the first place.

src/app/Http/Controllers/API/AuthController.php
172

This might be hard to see as it ended up being quite a refactoring. We had one instance where we called userResponse() before respondWithToken(). If you consider respondWithToken() could "respond" with an error (on auth failure) the heavy userResponse() call was redundant. Now we do this only on a successful response.

This revision is now accepted and ready to land.Feb 22 2022, 10:18 AM
This revision was automatically updated to reflect the committed changes.