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

Improve docs on the session prop #1071

Closed
sodic opened this issue Mar 21, 2023 · 1 comment · Fixed by #2535
Closed

Improve docs on the session prop #1071

sodic opened this issue Mar 21, 2023 · 1 comment · Fixed by #2535
Assignees
Labels
documentation Improvements or additions to documentation shouldfix We should do/fix this at some point

Comments

@sodic
Copy link
Contributor

sodic commented Mar 21, 2023

Wasp automatically passes the user prop to authenticated components (i.e., pages with auth: true).

We show this functionality in the todoApp tutorial, but our documentation only mentions the useAuth hook (which is a suboptimal way of getting the user because the hook can't know whether it's being called in an authenticated component).

Our documentation should clearly instruct our users to use the user prop whenever possible and only resort to the useAuth hook when they want to do something user-related in a non-authenticated component (e.g., headers).

Pay attention to our writing guide: https://github.com/wasp-lang/wasp/blob/main/web/docs/writingguide.md

@FranjoMindek
Copy link
Contributor

Changed with #2535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation shouldfix We should do/fix this at some point
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants