Skip to content
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

Reset password always responds with invalid token data #7116

Closed
MarcelBreska opened this issue Sep 18, 2020 · 4 comments
Closed

Reset password always responds with invalid token data #7116

MarcelBreska opened this issue Sep 18, 2020 · 4 comments
Assignees

Comments

@MarcelBreska
Copy link

MarcelBreska commented Sep 18, 2020

Goal

Reset Password with App.emailPassword.resetPasswordAsync(token, tokenId, newPassword)

Actual Results

Fails with the response "invalid token data". The HTTP Request show,
HTTP Request =
POST ****/auth/providers/local-userpass/reset
Accept: application/json
Content-Type: application/json;charset=utf-8
Accept: application/json
Content-Type: application/json;charset=utf-8
{"password":"***(my_token)","token":"my_tokenId","token_id":"my_password"}

BAD_REQUEST(realm::app::ServiceError:48): invalid token data

Steps & Code to Reproduce

By resetting the password the server response is alway " invalid token data". The console also shows, that the data gets mixed up. The function is declared as resetPasswordAsync(token, tokenId, newPassword) but the HTTP Request is showing, that the newPassword is set as tokenId, the token is set as password and the tokenId is the new password.
Even trying on shuffling the function values to --- App.resetPasswordAsync(newPassword, token, tokenId) --- the result ist the same. Except that the HTTP Request is correct.

Request is:
{"password":"***(my_token)","token":"my_tokenId","token_id":"my_password"}

should be:

{"password":"***(my_password)","token":"my_token","token_id":"my_tokenId"}

Version of Realm and tooling

Realm version(s): io.realm:realm-gradle-plugin:10.0.0-BETA.7

Realm Sync feature enabled: Yes

@cmelchior cmelchior self-assigned this Sep 21, 2020
@cmelchior
Copy link
Contributor

Hi @MarcelBreska Thank you. I can reproduce the problem, but there seems to be two issues here. The order of arguments are wrong as you pointed out, but even after fixing that I'm also getting "Invalid token data".

@MarcelBreska
Copy link
Author

MarcelBreska commented Sep 22, 2020

I had the same result by switching the arguments manually. The whole authentication seems a little bit off at the moment ;) Also the login with GoogleSignIn does not work properly. See issue #7119. Facebook-Signin is working though.

Looking forward for BETA.8 ;)

Thanks for looking into the issue!

@cmelchior
Copy link
Contributor

We discovered the root cause for this as well. We will ship a BETA.8 with fixes shortly (probably tomorrow)

@cmelchior
Copy link
Contributor

10.0.0-BETA.8 has been released with a fix.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants