-
Notifications
You must be signed in to change notification settings - Fork 27
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 client side auth #147
Add client side auth #147
Conversation
…show the same results
Hi is there any timeline for this? I am blocked to integrate into our existing app without major refactors. |
It’d be awesome to also show an implementation of Magic Auth using |
|
||
export default function MyComponent() { | ||
// Retrieves the user from the session or returns `null` if no user is signed in | ||
const { user, loading } = useAuth(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulAsjes this function no longer takes {ensureSignedIn: true}
for it's arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the comment below were fixed in v1.0.2.
const { user } = await withAuth({ ensureSignedIn: true }); | ||
|
||
// Client component | ||
const { user, loading } = useAuth({ ensureSignedIn: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulAsjes this doesn't work after the upgrade to version 1.x
Fixes #80
Hopefully fixes #146
Introduces new auth hooks via the
AuthKitProvider
component. Also separates server and client components so no crypto modules are accidentally included, causing errors in client components that attempt to use this library.