You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It could be nice to have many auth configs or providers. Currently, we can only have one setup.
My application uses the local provider with an external API.
Depending on the business workflow, I must use different endpoints to authenticate the user. Once authenticated, the tokens are the same as well as the refresh logic, no matter the endpoint used.
I can't override the endpoint settings when calling the signIn() method.
I'm currently overriding the configuration on demand (not clean but it works).
letinitialSignInconstconfig=useRuntimeConfig()const{ signIn }=useAuth()try{// [...]initialSignIn={ ...config.public.auth.provider.endpoints.signIn}config.public.auth.provider.endpoints.signIn={path: '/other/endpoint/path',method: 'post',}awaitsignIn({/* payload for the use case */},{callbackUrl: '/'},)}catch(error){// [...]}finally{// revert the initial settingsif(initialSignIn){config.public.auth.provider.endpoints.signIn=initialSignIn}}
Maybe there is a clean way to do it? If so, let me know.
How would you implement this?
The short way: Be able to override the settings set in the nuxt.config.ts file when calling signIn().
The long way: Be able to define many configs or providers in the nuxt.config.ts file.
In the nuxt v2 plugin, I used several strategies with local scheme, and it was perfectly matching my use case.
Additional information
Would you be willing to help implement this feature?
Provider
AuthJS
Local
Refresh
New Provider
The text was updated successfully, but these errors were encountered:
Describe the feature
It could be nice to have many auth configs or providers. Currently, we can only have one setup.
My application uses the
local
provider with an external API.Depending on the business workflow, I must use different endpoints to authenticate the user. Once authenticated, the tokens are the same as well as the refresh logic, no matter the endpoint used.
I can't override the endpoint settings when calling the
signIn()
method.I'm currently overriding the configuration on demand (not clean but it works).
Maybe there is a clean way to do it? If so, let me know.
How would you implement this?
The short way: Be able to override the settings set in the
nuxt.config.ts
file when callingsignIn()
.The long way: Be able to define many configs or providers in the
nuxt.config.ts
file.In the nuxt v2 plugin, I used several strategies with local scheme, and it was perfectly matching my use case.
Additional information
Provider
The text was updated successfully, but these errors were encountered: