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

The nuxt-auth@0.6.0-alpha.2 is not awaiting for the joinPathToApiURLWN on signinUrl of authjs (auth middleware / useAuth / signIn). #359

Closed
guesant opened this issue Apr 29, 2023 · 4 comments · Fixed by #360

Comments

@guesant
Copy link
Contributor

guesant commented Apr 29, 2023

Environment

Nuxi 3.4.2 17:46:15
17:46:15
RootDir: /mnt/tiedot/projetos/academic-tasks/academic-tasks-frontend 17:46:15
Nuxt project info: 17:46:15


  • Operating System: Linux
  • Node Version: v18.12.1
  • Nuxt Version: 3.4.2
  • Nitro Version: 2.3.3
  • Package Manager: npm@8.19.2
  • Builder: vite
  • User Config: runtimeConfig, modules, vite, css, build, auth, graphql-client
  • Runtime Modules: @vueuse/nuxt@10.1.0, nuxt-graphql-client@0.2.27, @sidebase/nuxt-auth@0.6.0-alpha.2, @nuxtjs/color-mode@3.2.0
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/nuxt-starter-tkpaqv?file=pages/protected.vue

Describe the bug

The auth middleware tries to redirect to the login pages, but the user is sent to /[object%20Promise]?callbackUrl=/protected.

image

I think the bug comes from here:

const signinUrl = joinPathToApiURLWN(nuxt, 'signin')

As long in the same file the await keyword is used for the same function:

const errorUrl = await joinPathToApiURLWN(nuxt, 'error')

Additional context

I'm available to make an PR.

Logs

No response

@guesant guesant added the bug label Apr 29, 2023
@guesant guesant changed the title The nuxt-auth@0.6.0-alpha.2 is not awaiting for the joinPathToApiURLWN on signinUrl of authjs (auth middleware). The nuxt-auth@0.6.0-alpha.2 is not awaiting for the joinPathToApiURLWN on signinUrl of authjs (auth middleware / useAuth / signIn). Apr 29, 2023
@BracketJohn
Copy link
Contributor

Ah, good catch? Want to open a PR? Otherwiese Ill do it (:

@guesant
Copy link
Contributor Author

guesant commented Apr 30, 2023

Ah, good catch? Want to open a PR? Otherwiese Ill do it (:

Thanks! I'll do.

@guesant
Copy link
Contributor Author

guesant commented Apr 30, 2023

PR: #360.

@BracketJohn
Copy link
Contributor

Thanks! Tests are running now, will do a release shortly (:

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 a pull request may close this issue.

2 participants