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

Hook for modifying the fields on AuthUser #2521

Open
infomiho opened this issue Feb 20, 2025 · 0 comments
Open

Hook for modifying the fields on AuthUser #2521

infomiho opened this issue Feb 20, 2025 · 0 comments
Labels

Comments

@infomiho
Copy link
Contributor

When users get the user in the pages that have authRequired: true or by using the useAuth hook they get the AuthUser object. This user object contains only the fields on the User entity and auth specific identities object.

I think we could provide a hook in Wasp that would allow users to customise the user object: adding new fields (like their role) or removing some sensitive fields (removing hasPaid).

We should be careful not to allow users to break Wasp's auth system while still giving them flexibility. The AuthUser type should reflect the new fields as well.

Related: https://ptb.discord.com/channels/686873244791210014/1340391750665109637/1341865419333570633

@infomiho infomiho added the auth label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant