Open source password analysis reset password error

I updated the parser server to run on AWS and I get this error when I click reset password, but login is working. I'm not sure why this part of the code has an error, and not another login and registration. Error Domain=Parse Code=1 "{"code":1,"message":"Internal server error."}" UserInfo={error={"code":1,"message":"Internal server error."}, NSLocalizedDescription={"code":1,"message":"Internal server error."}, code=1} enter image description here enter image description here This is the code I should use to reset.

 - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { switch (alertView.alertViewStyle) { case UIAlertViewStylePlainTextInput: { UITextField *textField = [alertView textFieldAtIndex:0]; NSLog(@"Plain text input: %@",textField.text); NSString *original = textField.text; NSString *lowercase = [original lowercaseString]; NSLog(@"lowercase == %@",lowercase); // [PFUser requestPasswordResetForEmailInBackground:@" connorsapps@yahoo.com "]; [PFUser requestPasswordResetForEmailInBackground:lowercase block:^(BOOL succeeded, NSError * _Nullable error) { NSLog(@"error == %@",error); if(error){ [[[UIAlertView alloc] initWithTitle:@"Password Reset Error" message:@"There was a Error reseting your email." delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil] show]; } else if (!error){ [[[UIAlertView alloc] initWithTitle:@"Password Reset" message:@"An email containing information on how to reset your password has been sent to your email." delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil] show]; } }]; } break; case UIAlertViewStyleSecureTextInput: { UITextField *textField = [alertView textFieldAtIndex:0]; NSLog(@"Secure text input: %@",textField.text); } break; case UIAlertViewStyleLoginAndPasswordInput: { UITextField *loginField = [alertView textFieldAtIndex:0]; NSLog(@"Login input: %@",loginField.text); UITextField *passwordField = [alertView textFieldAtIndex:1]; NSLog(@"Password input: %@",passwordField.text); } break; default: break; } } 
+1
source share
1 answer

Have you configured your email adapter?

Take a look at: https://github.com/ParsePlatform/parse-server

Verification and email password reset

Checking users email addresses and enabling the reset password by email requires an email adapter. As part of the parse-server package, we provide an adapter for sending e-mail through Mailgun. To use it, register with Mailgun and add it to your initialization code:

 var server = ParseServer({ ...otherOptions, // Enable email verification verifyUserEmails: true, // The public URL of your app. // This will appear in the link that is used to verify email addresses and reset passwords. // Set the mount path as it is in serverURL publicServerURL: 'https://example.com/parse', // Your apps name. This will appear in the subject and body of the emails that are sent. appName: 'Parse App', // The email adapter emailAdapter: { module: 'parse-server-simple-mailgun-adapter', options: { // The address that your emails come from fromAddress: ' parse@example.com ', // Your domain from mailgun.com domain: 'example.com', // Your API key from mailgun.com apiKey: 'key-mykey', } } }); 

You can also use other email adapters provided by the community, such as parse-server-sendgrid-adapter or parse-server-mandrill-adapter.

Add this to the parsing server instance, if you download the parser from git, it will initially look lower.

 var api = new ParseServer({ serverURL: process.env.SERVER_URL, databaseURI: databaseUri || 'mongodb://localhost:27017/dev', cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js', appId: process.env.APP_ID || 'myAppId', masterKey: process.env.MASTER_KEY || '' //Add your master key here. Keep it secret! }); 

So, add the first code snippet to the bottom of the above sample.

 var api = new ParseServer({ serverURL: process.env.SERVER_URL, databaseURI: databaseUri || 'mongodb://localhost:27017/dev', cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js', appId: process.env.APP_ID || 'myAppId', masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret! verifyUserEmails: true, publicServerURL: 'https://example.com/parse', // Your apps name. This will appear in the subject and body of the emails that are sent. appName: 'Parse App', // The email adapter emailAdapter: { module: 'parse-server-simple-mailgun-adapter', options: { // The address that your emails come from fromAddress: ' parse@example.com ', // Your domain from mailgun.com domain: 'example.com', // Your API key from mailgun.com apiKey: 'key-mykey', } } }); 
+4
source

All Articles