GithubHelp home page GithubHelp logo

Comments (12)

alexblack avatar alexblack commented on August 21, 2024

Bump :)

from parse-sdk-js.

stanleyw avatar stanleyw commented on August 21, 2024

Hi Alex, Based on the info you provided, its unclear to me whether the user didn't become non-anonymous because the logic prior to the signUp call failed. Do you have some logs demonstrating that signUp was actually executed?

Could you try removing all code except for just set username, set password, and signUp to help narrow down the range of possibilities? If you can repro with this simpler case, please also provide info like SDK version number. Thanks!

from parse-sdk-js.

parse-github-bot avatar parse-github-bot commented on August 21, 2024

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

from parse-sdk-js.

alexblack avatar alexblack commented on August 21, 2024

Hi Stanleyw, yes the fact that the function succeeded without errors would be logged in the logs at parse. It looks like it doesn't let me go back that far though, I assume you have more powers than me in that department.

Another way I know it succeeds because reset password emails get sent out.

Also, we can tell that nothing before the signup call failed because the username and password were actually set on the user.

from parse-sdk-js.

stanleyw avatar stanleyw commented on August 21, 2024

@alexblack What version of JS SDK did you use?

from parse-sdk-js.

alexblack avatar alexblack commented on August 21, 2024

@stanleyw 1.4. I'll retest on Monday with the latest.

from parse-sdk-js.

stanleyw avatar stanleyw commented on August 21, 2024

I dug into this further, here is what I've found:

  • Looks like the Parse backend has always left the anonymous authData unchanged when an anonymous user gets upgraded to a normal user via setting username/password. You can reproduce this by calling the Parse REST API directly to save the user. We can't really change this backend behavior because we don't know whether anyone relies on this today.
  • The JS SDK currently does not support anonymous user manipulation (i.e. Parse.AnonymousUtils doesn't exist), so there is no JS unlink method. However, if you really want to unlink the user from the anonymous authData, you can use the REST API (https://www.parse.com/docs/rest/guide#users-unlinking). The Cloud Code equivalent is:
    Parse.Cloud.httpRequest({
      method: 'PUT',
      url: 'https://api.parse.com/1/users/' + yourUser.id,
      body: '{ "authData": { "anonymous": null }}',
      headers: {
        'Content-Type': 'application/json',
        'X-Parse-Application-Id': Parse.applicationId,
        'X-Parse-Master-Key': Parse.masterKey
      }
    }).then(function(httpResponse) {
      console.log(httpResponse.text);
    }, function(httpResponse) {
      console.error('Request failed ' + httpResponse.status + ' ' + httpResponse.text);
    });

Let us know whether this workaround works!

from parse-sdk-js.

alexblack avatar alexblack commented on August 21, 2024

Hi @stanleyw thanks for looking into it. Is it a bug then?

I will try the work around to try to fix up the signUp call. Its strange that the signUp call in the JS SDK gives different results than the Android SDK.

from parse-sdk-js.

alexblack avatar alexblack commented on August 21, 2024

Currently I have this code in my Android app to work around the bug:

    final ParseUser user = ParseUser.getCurrentUser();
    // hack: if we use the cloud function requestPasswordResetInBackgroundAnonymous to upgrade an anonymous user
    // then Parse still thinks its anonymous, so lets check the username and see if its set to an email address (which we would have done)
    // see: https://github.com/ParsePlatform/Parse-SDK-JS/issues/13
    if (!ParseAnonymousUtils.isLinked(user) || Fmt.isValidEmail(user.getUsername()) ) {

from parse-sdk-js.

parse-github-bot avatar parse-github-bot commented on August 21, 2024

This issue has not been updated for 7 days. If you have additional information to help pinpoint this issue as an SDK bug, please comment on this issue. We will close this issue in 7 days if no additional information is provided. Thank you for your feedback.

from parse-sdk-js.

stanleyw avatar stanleyw commented on August 21, 2024

Thanks for the new info, dug into this more and realized that our iOS and Android SDKs strip the authData client-side. See https://github.com/ParsePlatform/Parse-SDK-Android/blob/master/Parse/src/main/java/com/parse/ParseUser.java#L429

We'll look into doing the same for the JS SDK.

from parse-sdk-js.

alexblack avatar alexblack commented on August 21, 2024

Great.

from parse-sdk-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.