-
Notifications
You must be signed in to change notification settings - Fork 134
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
[V3] ios login errors from loginWithEmailAndPassword coming back as undefined #288
Comments
@SamMatthewsIsACommonName , I was having the same issue. I have created a pull request to resolve this precise issue : #304 seems to be due to a variable name mismatch. |
Hey @jsbranco thanks that's interesting and as you say does work. The error codes are all new yet again haha (possibly the 5th format of error codes we've had so far) We've been working on this kind of on an alternative branch and it was noted that a problem was arising as a result of the '/auth' extension in the lib/modules/auth/index.js file, as referenced here: Salakar#18 . You'll see there I also made a kind of quick and dirty switch module for standardising a message output and if you look there you'll see all the different 'error codes' I've gotten up to this point. It is all kind of a mystery to me haha! |
@SamMatthewIsACommonName I see, so in V3 it shouldnt be using auth/? Or simply the auth/ format was changed but the ios files were not updated as per the latest :)? I am just asking to check if my change is correct as that fix was honestly from debugging and trying to trace the issue |
I'm honestly not sure haha... I mean both kind of work but in different ways (ie they produce completely different error codes) |
May I vote for #304 to be merged into this fork? |
@designorant my personal vote would be for you solution of removing the '/auth' as that produces error codes which are at least documented in some places... i.e the error in the example would be 'code: 17007, message: 'The email....' |
@jsbranco are you able to try with your solution as well as removing the '/auth', and see what format the codes you get are? |
@SamMatthewsIsACommonName And my error code is:
|
Thanks so that's no change right? Would you be able to keep the '/auth' removed and revert your solution back to how it was and see if you get an error code of 17007? I'm just trying to establish that there is actually some level of consistency |
Sorry @SamMatthewsIsACommonName I just checked.. it was still running the code with auth/ so after fresh restart, the error object has an additional attribute after removing "auth/" although error code is still the same: Object {error: "createUserWithEmailError", message: "The email address is already in use by another account.", code: "272115"} I will test it without my changes shortly. |
Without my changes and without auth/ the result is the following:
|
OK great thanks so much for testing that out. Well that all being the case my vote would still be for the one that produces the 17007 purely because there are resources such as this one documenting all the codes: Edit: although maybe we can make use of the error attribute to find examples, as I was going off of the actual code but the error values seem quite universal. Also sorry to confirm you are getting the 17007 as 'name' prop rather than 'code'? |
Oh, sorry, I only now realised that we're getting totally different code numbers there. Since it seems to be related to #252, it would be great to see whether @Salakar and @chrisbianca have any thoughts on what's going on here. |
@SamMatthewsIsACommonName thats right, 17007 is coming as name rather than code. If I assign it as code it will trigger a lowerCase function not applicable in javascript. Because the code is suppose to be a string ( I believe). The interesting thing is if I debug the error object in Objective C I do see the code as 17007, but I am doing a casting EDIT:
|
Can you try NSString stringWithFormat:@"%i" as if you were beginning with an integer? |
@SamMatthewsIsACommonName I just did this :
|
@SamMatthewsIsACommonName without auth/ and with the fix of casting the result looks better:
|
Yeah that looks good! Currently without '/auth' I'm getting the code as a number so will be much more consistent to have it as a string |
I shall update my PR with the casting change Update: PR updated. |
@SamMathewIsACommonName I just updated my PR since I was also having the following issue when using signWithEmailAndPassword : The commit follows the same changes I did for create a user with email / password : The error output is now like this :
|
Awesome! I think @auser is responsible for committing pull requests on this branch. Looks good though! |
@auser is there anything else required from my side (update docs or other step) as this my first PR on this library. Kind Regards |
+1 |
Hi so I'm using the latest v3 branch like this:
which works if I provide the right email and password, but any error I get back is just coming back as an object with code of "" and message of undefined:
once I have some error messages to go off I'm finally going to get around to making that error code nromalising module Ive been promising forever, but I need an error code haha
The text was updated successfully, but these errors were encountered: