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

Password reset doesn't work with user beforesave #951

Closed
carmenlau opened this issue Mar 10, 2016 · 3 comments
Closed

Password reset doesn't work with user beforesave #951

carmenlau opened this issue Mar 10, 2016 · 3 comments
Labels
type:question Support or code-level question

Comments

@carmenlau
Copy link
Contributor

Update password in reset password page will redirect to Successfully updated your password! page. But the password is not updated properly.

The request object in user before save is empty.

Let me know if any information could help!

@flovilmart
Copy link
Contributor

This feature is still experimental, that would be nice to have more information about your configuration, the options you passed to ParseServer etc...

@carmenlau
Copy link
Contributor Author

Thanks @flovilmart Please find the information below and hope they are helpful.

Configuration

var api = new ParseServer({
  appName: "",
  databaseURI: databaseUri || '',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || '',
  masterKey: process.env.MASTER_KEY || '',
  serverURL: process.env.SERVER_URL || '',
  fileKey: process.env.FILE_KEY || '',
  filesAdapter: new S3Adapter(
    process.env.AWS_ACCESS_KEY_ID || ''
    process.env.AWS_SECRET_ACCESS_KEY || '',
    process.env.BUCKET_NAME || '',
    { directAccess: true }
  ),
  push: {
    ios: {
      pfx: process.env.APN_P12_FILE_PATH || '',
      bundleId: process.env.APN_BUNDLE_ID || '',
      production: process.env.APN_PRODUCTION || false
    }
  },
  publicServerURL: process.env.SERVER_URL || '',
  emailAdapter: SimpleMailgunAdapter({
    apiKey: '',
    domain: '',
    fromAddress: 'support@testing.com',
  })
});

Testing steps

  1. Request reset password
  2. Got reset password email
  3. Follow the link to reset password
  4. See the Successfully updated your password! page
  5. Login again, but the password was not changed

When we test on step 3, reset password fail inside our user before save function. We validate the username in the user before save function, but request.object.getUsername() is empty during reset password.

We tried remove the validation logic and changed to the following. Reset password still doesn't work.

Parse.Cloud.beforeSave(Parse.User, function(request, response) {
    response.success();
});

The reset password works again, after I completely remove the user before save function.

Parse server version

v2.1.5

carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 22, 2016
… object in user before save is empty when reset password. parse-community#951
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 22, 2016
…is not a parse field, cannot clear it through rest. Update it separately. parse-community#951
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 22, 2016
…is not a parse field, cannot clear it through rest. Update it separately. parse-community#951
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 22, 2016
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 23, 2016
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 23, 2016
… object in user before save is empty when reset password. parse-community#951
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 23, 2016
…is not a parse field, cannot clear it through rest. Update it separately. parse-community#951
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 23, 2016
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 23, 2016
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 24, 2016
… object in user before save is empty when reset password. parse-community#951
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 24, 2016
…is not a parse field, cannot clear it through rest. Update it separately. parse-community#951
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 24, 2016
carmenlau added a commit to carmenlau/parse-server that referenced this issue Mar 24, 2016
@flovilmart
Copy link
Contributor

Looks like it's fixed.

@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants