Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop returning defaults when using User.getPublicUser() #1208

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DEVTomatoCake
Copy link
Member

@DEVTomatoCake DEVTomatoCake commented Sep 1, 2024

Slightly annoying, confusing and sending unnecessary bytes, so I've fixed the User.getPublicUser() method to only return the properties that are actually needed for, well, public users.

Currently, properties like desktop and webauthn_enabled are returned with their default values, which, while not exposing anything, are not matching the schemas.

This PR adjusts the method to call <User>.toPublicUser() and removes arguments which were rarely used and can be replaced with e.g. User.findOneOrFail().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant