how to build on top of useSession?
Hello! As an exercise to understand client plugins better, I would like to add a
useUser
method to the auth client. All I want is for it to leverage the existing useSession
and extract out the user
data object without directly making a server call.
I looked into getActions but don't see a way to access the current auth client object, i.e. something equivalent to the "this" reference in order to call useSession
.
Could someone more experienced in this let me know if this is possible and/or suggest an alternate approach? I'm currently using solidstart but suspect that the answer would be platform-agnostic. I can always define useUser
outside of authClient but was wondering if it is doable via a plugin instead.
Thank you in advance.1 Reply
bump