#how to handle responses from the server on the client?

2 messages · Page 1 of 1 (latest)

lean cairn
#

I'm trying to implement server side auth with a cookie, the cookie part it's working, but the thing is I want to save my user info - that is returned by the login function (name, avatar, etc) - in a context in order to use it across the app. How do I go about handling the response on the client in order to properly set it in the context ?

#
  const [loggingIn, logIn] = createServerAction$(
    async (form: FormData, { locals }) => {
      return await logInFn(form, locals);
    }