Page MenuHomePhorge

User profile (Bifrost#T331493)
ClosedPublic

Authored by machniak on Feb 25 2020, 9:48 AM.
Tags
None
Referenced Files
F11767545: D970.diff
Wed, Apr 17, 7:37 AM
Unknown Object (File)
Sat, Apr 6, 6:04 AM
Unknown Object (File)
Tue, Apr 2, 8:49 AM
Unknown Object (File)
Mar 18 2024, 6:35 AM
Unknown Object (File)
Mar 11 2024, 10:17 AM
Unknown Object (File)
Mar 7 2024, 12:35 AM
Unknown Object (File)
Feb 25 2024, 2:09 PM
Unknown Object (File)
Feb 21 2024, 8:18 AM
Subscribers
None

Diff Detail

Repository
rK kolab
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

machniak created this revision.
vanmeeuwen added inline comments.
src/app/Http/Controllers/API/UsersController.php
293

Can these both just be if (!empty())?

src/app/Http/Kernel.php
22 โ†—(On Diff #2341)

Why is this disabled?

This revision now requires changes to proceed.Feb 25 2020, 10:13 AM
src/app/Http/Controllers/API/UsersController.php
267

phpstan tells me update() may also return void... which is from the abort() returns?

src/app/Http/Controllers/API/UsersController.php
267

I'll fix all API controllers code to always respond with JSON, and not use abort().

293

Could work untill we want to support passwords like "000000000" and other "nullable" strings.

src/app/Http/Kernel.php
22 โ†—(On Diff #2341)

I found it problematic with input validation. Not impossible, but harder to handle . For example, user settings cannot be NULL at the moment, so to reset (set to an empty value) a setting we just POST empty strings. If they are converted to null, we need to add more code to detect that.

  • Re-enable ConvertEmptyStringsToNull middleware
  • Always return JSON responses from API, even on 403/404 errors
This revision is now accepted and ready to land.Feb 25 2020, 1:27 PM
This revision was automatically updated to reflect the committed changes.