-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Laravel Passport redirecting without authentication #720
Comments
Hi @gilles6 👋 This is going to be a pretty tricky bug to recreate and investigate. As I am not very familiar with Laravel Passport, I think it makes sense if we schedule a quick call, in which you can screen share and give me a proper overview. Could you please add me on discord, so we can discuss there: zoeykaiser |
@zoey-kaiser Thank you very much for your reply, it finally worked but I can't remember why...
It doesn't pass Laravel's |
Great to hear that it worked 💯
Do you need to pass an |
@zoey-kaiser Thanks again for your kind reply. Actually, I need to do the exact same kind of fetch that the one successfully done to get user info. It needs to pass this Laravel route in
|
When you make this fetch call (eg. in Postman) what would it look like? Do you need to set an Authentication Header? I am having a few issues exactly following your explanation, as I have also never used Laravel before. |
Everything works fine with Postman : GET authorize, POST token, GET user, and no problem to make further call using the token provided by Laravel. Because Laravel Passport token doesn't seem to be stored by sidebase, I'm adding it to the get user query. I can see it in nuxt logs (when passing I followed this guide so my
However, |
Environment
Working directory: /Users/me/mycompany/beta/bo 10:21:40
Nuxt project info: (copied to clipboard) 10:21:40
👉 Report an issue: https://github.com/nuxt/nuxt/issues/new 10:21:40
👉 Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new
👉 Read documentation: https://nuxt.com
Reproduction
Prepare Laravel environement
Callback:
http://localhost:3000/api/auth/callback/laravelpassport
vim app/Models/User.php
vim config/auth.php
vim routes/api.php
Test
When logging from Nuxt website with sidebase/nuxt-auth, it works fine with Google, Github or Twitch, but I'm getting problems with Laravel Passport. I'm properly redirected to the login page, I can sign in, then I get the authorization request, then I'm redirected back to Nuxt website unauthenticated while I'm actually authenticated in Laravel.
Below is my
sidebase/nuxt-auth
config:How can I fix this issue?
Describe the bug
ERROR [next-auth][error][OAUTH_CALLBACK_ERROR]
https://next-auth.js.org/errors#oauth_callback_error outgoing request timed out after 3500ms { error:
{ RPError: outgoing request timed out after 3500ms
at /Users/me/mycompany/beta/bo/node_modules/.pnpm/openid-client@5.6.1/node_modules/openid-client/lib/helpers/request.js:137:13
at async Client.grant (/Users/me/mycompany/beta/bo/node_modules/.pnpm/openid-client@5.6.1/node_modules/openid-client/lib/client.js:1343:22)
at async Client.oauthCallback (/Users/me/mycompany/beta/bo/node_modules/.pnpm/openid-client@5.6.1/node_modules/openid-client/lib/client.js:620:24)
at async oAuthCallback (/Users/me/mycompany/beta/bo/node_modules/.pnpm/next-auth@4.21.1_next@13.5.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/lib/oauth/callback.js:111:16)
at async Object.callback (/Users/me/mycompany/beta/bo/node_modules/.pnpm/next-auth@4.21.1_next@13.5.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/routes/callback.js:52:11)
at async AuthHandler (/Users/me/mycompany/beta/bo/node_modules/.pnpm/next-auth@4.21.1_next@13.5.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/index.js:201:28)
at Object.handler (/Users/me/mycompany/beta/bo/node_modules/.pnpm/@sidebase+nuxt-auth@0.7.0_next-auth@4.21.1/node_modules/@sidebase/nuxt-auth/dist/runtime/server/services/authjs/nuxtAuthHandler.mjs:88:24)
at async file:///Users/me/mycompany/beta/bo/node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:1962:19
at async Object.callAsync (file:///Users/me/mycompany/beta/bo/node_modules/.pnpm/unctx@2.3.1/node_modules/unctx/dist/index.mjs:72:16)
at async Server.toNodeHandle (file:///Users/me/mycompany/beta/bo/node_modules/.pnpm/h3@1.11.1/node_modules/h3/dist/index.mjs:2249:7)
name: 'OAuthCallbackError',
code: undefined },
providerId: 'laravelpassport',
message: 'outgoing request timed out after 3500ms' }
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: