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

[nuxt] error in version 0.10.0-rc.2 of sidebase #962

Closed
DoctorNorriq opened this issue Dec 17, 2024 · 7 comments
Closed

[nuxt] error in version 0.10.0-rc.2 of sidebase #962

DoctorNorriq opened this issue Dec 17, 2024 · 7 comments
Labels
question A question about NuxtAuth

Comments

@DoctorNorriq
Copy link

DoctorNorriq commented Dec 17, 2024

Environment

Reproduction

No minimal reproduction provided

Describe the bug

Error when running dev server with: "@sidebase/nuxt-auth": "^0.10.0-rc.2"

nuxt-sidebase-bug

Additional context

I tried switching to an earlier version of sidebase, where the problem did not persist. When I then switched back to 0.10.0-rc.2, the error was gone. The only difference I can see is a "license": "MIT" added in my package-lock.json to the node_modules/@sidebase/nuxt/auth object.

image

P.s, this is my first bug report, so I hope the provided info is enough to understand the scope of the issue :)

Logs

No response

@DoctorNorriq DoctorNorriq added bug A bug that needs to be resolved pending An issue waiting for triage labels Dec 17, 2024
@DoctorNorriq DoctorNorriq changed the title [nuxt] error in version 0.10.0-rc-2 of sidebase [nuxt] error in version 0.10.0-rc.2 of sidebase Dec 17, 2024
@zoey-kaiser
Copy link
Member

Hi @DoctorNorriq 👋

This is because v0.10 contains several breaking changes! I am currently finalizing the upgrade guide to make the migration easier. I can help you out here if you could share the following with me:

  • Auth configuration in the nuxt.config.ts
  • Environment variable you currently use to set the AUTH_ORIGIN

@zoey-kaiser zoey-kaiser added question A question about NuxtAuth and removed bug A bug that needs to be resolved pending An issue waiting for triage labels Dec 17, 2024
@DoctorNorriq
Copy link
Author

DoctorNorriq commented Dec 17, 2024

Cheers, Zoey!

Affirmative :)

{
  auth: {
    isEnabled: true,
    baseURL: 'HIDDEN',
    provider: {
      type: 'local',
      pages: {
        login: '/login',
      },
      endpoints: {
        signIn: { path: 'Login', method: 'post' },
        getSession: { path: 'GetUser' },
        signOut: { path: 'logout', method: 'get' },
      },
      refresh: {
        isEnabled: true,
        endpoint: { path: 'GetAccessToken', method: 'post' },
        token: {
          signInResponseRefreshTokenPointer: '/refreshToken',
        },
      },
      token: {
        signInResponseTokenPointer: '/accessToken',
        maxAgeInSeconds: 60 * 5, // 5 min
        sameSiteAttribute: 'lax',
      },
    },
    sessionRefresh: {
      enableOnWindowFocus: false,
      enablePeriodically: 1 * 60 * 2 * 1000, // 2 minutes
    },
    globalAppMiddleware: {
      isEnabled: true,
    },
  }
}

I can't seem to find anything regarding AUTH_ORIGIN; any ideas where I might find the env var? I don't believe we're setting it anywhere. Do we need to do so? :)

@zoey-kaiser
Copy link
Member

zoey-kaiser commented Dec 17, 2024

Hi @DoctorNorriq 👋

Sadly I cannot conclude anything else from the console error you sent over. Could you please create a minimal reproduction of the issue using this minimal local starter template: https://stackblitz.com/github/zoey-kaiser/nuxt-auth-starters

@phoenix-ru
Copy link
Collaborator

Hi, the actual problem is that rc2 is published as latest, when it should've been just next as rc1
image

I will investigate your issue in the meantime, but you can switch to a stable 0.9.4 for now

@phoenix-ru
Copy link
Collaborator

@DoctorNorriq do you still have the error with 0.10.0-rc.2? I think it may have been related to NPM caching rather than our module

@OlePc
Copy link

OlePc commented Dec 19, 2024

@phoenix-ru I asked @DoctorNorriq to open the issue. But I agree. It seems to be a NPM issue more than an issue with the module. We need 0.10.0-rc.2, though, to be able to overwrite baseURL using an environment variable. You may close the issue 👍

@zoey-kaiser
Copy link
Member

Awsome! Great to hear 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about NuxtAuth
Projects
None yet
Development

No branches or pull requests

4 participants