Open iamKiNG-Fr opened 3 months ago
Hi @iamKiNG-Fr 👋
I agree that it makes sense to enhance and revisit the signUp
flow! I saw that your checked the box that you would be willing to help us implement this feature!
As the signUp
flow is very isolated from the other parts of authentication, I don't think you need to worry about breaking anything! From my perspective the signUp
flow should consist of the following:
signUp
flow is returned
session.dataType
?signIn
if this function should also be executed, maybe you have some other ideas here?).I stumbled across this, trying to catch failing login requests in the refresh
provider, which is seemingly not possible atm. At least by await
ing the signIn
call.
When there is anything I can help with getting this fixes, I'm happy to help out ;-)
But I like the proposed solution of providing an option to return the response of the fetch call. This would allow for detailed errors messages from the server on failed logins.
Describe the feature
The Feature
To allow
SignUp()
useAuth local composable return data from signup request.The Journey
I'm unable to get the return data from the Signup request I send. This request contains data that is important for my applications signup process.
This puzzled me for a while after I tried assigning a variable to the
signup()
sidebase useAuth() function and then log that variable, only to get anundefined
value even when i could see the response with the dev tools.chrome dev tool
The Discovery
After further investigation, i noticed that the sidebase nuxt-auth local composable where the signup function is defined actually doesn't return the data from the signup request.
you'll notice that when
signUpOptions?.preventLoginFlow
istrue
like i have in my code{ preventLoginFlow: true }
it returns zelch nothing.And i believe this is the culprit.
How would you implement this?
The Solution
Well I don't know if I'm savvy enough to implement the solution but from what i can see it looks like adding a variable to hold the response from the
signup()
_fetch
request and then returning the variable with the data is the way to go.for example
then maybe adjust the accompanying typescript file to reflect the changes to ensure type safety.
Implementation
it'll be cool if i could implement this change under someone's supervision/guidance so i don't break anything, if not that's fine...or maybe there's nothing to fix and i just need someone to help me figure out how i can get this data from the signup function.
Additional information
Provider