sidebase / nuxt-auth

Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
https://auth.sidebase.io
MIT License
1.29k stars 164 forks source link

Please help me solve this Error: Callback for provider type credentials not supported #469

Closed DevHumbleChris closed 1 year ago

DevHumbleChris commented 1 year ago

Discussed in https://github.com/sidebase/nuxt-auth/discussions/468

Originally posted by **DevHumbleChris** June 29, 2023 I have setup everything correctly but still I keep getting this error. Error: Callback for provider type credentials not supported ![image](https://github.com/sidebase/nuxt-auth/assets/63234437/822e5a99-6d94-455f-be93-4cb00e956bf7) ![image](https://github.com/sidebase/nuxt-auth/assets/63234437/a5168412-8970-44b8-a705-7e779bcf5fa1) ![image](https://github.com/sidebase/nuxt-auth/assets/63234437/e8671197-5c34-4829-b9ab-ca495c9e0da0) ![image](https://github.com/sidebase/nuxt-auth/assets/63234437/95f0eeb0-5ef5-4cec-be49-0b5d1cbb0e4f) Please help me
asokr commented 1 year ago

show yours /api/auth/[...].js file

SoundFractures commented 1 year ago

Yeah I'm having the same issue. Currently just trying to make my sign-in method console.log the credentials. Here is my ~/server/api/auth/[...].ts file:

Screenshot 2023-07-07 at 09 27 53

selemondev commented 1 year ago

Hey @DevHumbleChris and @SoundFractures, if you have a backend or static Nuxt application, use the local provider to authenticate users based on their email and password. For OAuth providers such as Google, Github, Twitter etc, use the authjs provider. You can learn more about this here: https://sidebase.io/nuxt-auth/v0.6/getting-started#which-provider-should-i-pick

DevHumbleChris commented 1 year ago

@selemondev It's the local strategy that I did used and still went to get the same error.

selemondev commented 1 year ago

For any OAuth related authentication, go with nuxt-sidebase-auth v0.5 since it utilizes next-auth under the hood, but if you need fine grained control over the authentication flow, go with nuxt-sidebase-auth v0.6 pre-release. Check it out here: https://sidebase.io/nuxt-auth/v0.6/getting-started#which-provider-should-i-pick

bmhtech07 commented 1 year ago

Did anyone make any progress with this?

I'm facing exactly the same...

volodin-artem commented 1 year ago

Who got same issue i put callbackUrl on signIn function call like this signIn('credentials', { email: email.value, password: password.value, callbackUrl: '/dashboard' }); and this worked really fine for me on 0.6.0-beta.3 version

develth commented 2 months ago

I get the same error when i'am unauthenticated and want to access a page that is protected by middleware. I permantly get redirected to /api/auth/callback/credentials. LoginPages etc. getting ignored. When i`am logged in, everything is fine.

develth commented 2 months ago

@develth try this template i did create:

https://github.com/DevHumbleChris/nuxt-lucia-auth

seem like this would result in use own middleware etc & not work with nuxt-auth?