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

useSupabaseSession (.value) in middleware is null when landing on page directly #349

Closed
franzwarning opened this issue Apr 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@franzwarning
Copy link

When doing client side transitions, accessing the .value of useSupabaseSession works perfectly. When hitting the page directly, the session.value is null when it shouldn't be. However, the session object looks ok...

middlewaresession: ObjectRefImpl {
  _object:
   { '$ssupabase_user':
      { id: '4f5046ab-c291-4519-9415-89efe53e6951',
        aud: 'authenticated',
        role: 'authenticated',
        email: 'xxx',
        email_confirmed_at: '2024-04-11T23:09:56.171727Z',
        phone: '',
        confirmed_at: '2024-04-11T23:09:56.171727Z',
        last_sign_in_at: '2024-04-13T11:14:43.939754Z',
        app_metadata: [Object],
        user_metadata: {},
        identities: [Array],
        created_at: '2024-04-11T23:09:56.16799Z',
        updated_at: '2024-04-13T11:14:43.940623Z' },
     '$s__nuxt_devtools__': { timeSsrStart: 1713009709216 },
     '$ssupabase_session': null },
  _key: '$ssupabase_session',
  _defaultValue: undefined,
  __v_isRef: true }

any ideas here?

@franzwarning franzwarning added the bug Something isn't working label Apr 13, 2024
@vinceglb
Copy link
Contributor

vinceglb commented Apr 17, 2024

I faced the same issue.

I tried to reproduce using the playground in this repository without success.
But I tried to remove modifications done in this commit #338 (comment) and I reproduce the behavior.

Also, the issue #350 makes me think that the commit 9dee37e is not shipped in the 1.2.0.

@larbish, are you sure to ship this 9dee37e in the latest version?

Copy link
Collaborator

larbish commented Apr 18, 2024

Everything has been shipped in v1.2.1 (including your improvement @vinceglb), could you have a test ?

@vinceglb
Copy link
Contributor

@larbish It's working perfectly well, thanks a lot 🙏

@larbish larbish closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants