parsing开源服务器重置密码错误

我更新了parsing服务器在AWS上运行,当我点击重置密码但login工作时,我得到这个错误。 我不知道为什么这部分的代码有一个错误,而不是其他login和注册。 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} 在这里输入图像说明 在这里输入图像说明 这是我必须重置它的代码。

 - (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; } } 

你是否设置了电子邮件适配器?

看看: https : //github.com/ParsePlatform/parse-server

电子邮件validation和密码重置

validation用户的电子邮件地址并通过电子邮件地址重新启用密码重置电子邮件适配器。 作为parse-server包的一部分,我们提供了一个通过Mailgun发送邮件的适配器。 要使用它,请注册Mailgun,并将其添加到您的初始化代码中:

 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', } } }); 

您还可以使用社区贡献的其他电子邮件适配器,如parse-server-sendgrid-adapter或parse-server-mandrill-adapter。

把这个添加到分析服务器的实例化中,如果你从git下载了分析服务器,它最初看起来像下面的样子。

 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! }); 

因此,将第一个代码片段附加到上面示例的底部。

 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', } } });