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.31k stars 164 forks source link

fix: don't send sign-in options in request payload #755

Closed despatates closed 5 months ago

despatates commented 5 months ago

๐Ÿ”— Linked issue

https://github.com/sidebase/nuxt-auth/issues/411

โ“ Type of change

๐Ÿ“š Description

When using method signIn(credentials, { callbackUrl: '/' }) method with local or refresh provider, the callbackUrl and other options were sent to the server.
As mentioned in https://github.com/sidebase/nuxt-auth/issues/411#issuecomment-1612376120, some servers can reject the request if the payload contains invalid parameters.

Those options are only used when the sign-in request is done, they shouldn't be sent to the server. They can be set directly in credentials data if they have to.

Flagged as breaking change because some options may have to be copied from signInOptions to credentials.

๐Ÿ“ Checklist

phoenix-ru commented 5 months ago

Hi, thank you for your PR, it looks good already. As per

Flagged as breaking change because some options may have to be copied from signInOptions to credentials.

I think it's safe to assume that options shouldn't be sent to the server and anyone relying on that should instead send options in the sign in body.

Ulrich-Mbouna commented 5 months ago

Yes i faced the same issue

sandrinejoy commented 4 months ago

is this fixed? I am still facing this issue when using signIn(payload, { external: true, redirect: false }); the options are send as the payload

despatates commented 4 months ago

The issue is fixed but not yet released. If you don't want to wait, install the 0.8.0-alpha.2 version (this is what I did).