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

Add a non-hook way to get the current authed user #397

Open
kmjennison opened this issue Dec 21, 2021 · 0 comments
Open

Add a non-hook way to get the current authed user #397

kmjennison opened this issue Dec 21, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kmjennison
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Developers might want to get the authenticated user outside of a React component context. For example, an app we're building has a fetcher—used within a Relay environment that's created outside of the React tree—that needs the user's ID token. It's been unnecessarily difficult to get access to the latest AuthUser instance in this context. Our app's state management is partly to blame for the complexity, but our lives would be easier if we could just call for the latest ID token directly without relying on a React hook. For now, we ended up getting the current user directly from Firebase when on the client side (PR).

Describe the solution you'd like and how you'd implement it

This library could provide the equivalent to Firebase's firebase.auth().currentUser, returning an AuthUser instance. It would also need to be functional on the server side.

Is this a breaking change?

No.

Describe alternatives you've considered

None that I can think of. Alternative suggestions welcome!

@kmjennison kmjennison added the enhancement New feature or request label Dec 21, 2021
@kmjennison kmjennison added the help wanted Extra attention is needed label Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant