Skip to content

Conversation

@Gerbuuun
Copy link
Contributor

@Gerbuuun Gerbuuun commented Mar 11, 2024

I have added a public object to the SessionData which still contains the User type like before.
The setUserSession and replaceUserSession have the parameters as described in #47

The SessionData type is no longer exposed in favor of PublicSessionData and PrivateSessionData.
(only used internally from now on)

I'm not really sure about this solution yet.
What I'm thinking is to let go of the user property as a session check and instead just use public like user is used right now. There won't be a built in computed user but this can easily be added by wrapping the useUserSession:

export default function userStore() {
  const { session, clear, fetch, loggedIn } = useUserSession();

  const user = computed(() => session.value.user || null);

  return {
    user,
    session,
    clear,
    fetch,
    loggedIn
  };
}

This way you don't have to use user and can add anything you want (as long as there is something)
Problem is.. useUserSession is already taken as composable name

@Gerbuuun
Copy link
Contributor Author

implemented in #171

@Gerbuuun Gerbuuun closed this Sep 14, 2024
@Gerbuuun Gerbuuun deleted the feat/private-session-data branch September 14, 2024 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant