解析开源服务器重置密码错误

2023-12-14

I updated the parse server to run on AWS and I get this error when I hit the reset password but the login works. I am not sure why this part of the code is having a error and not the other login and sign up. 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 hereenter image description here This is the code I have to reset it.

- (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:@"[email protected]"];

    [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

电子邮件验证和密码重置

验证用户电子邮件地址并通过电子邮件启用密码重置需要电子邮件适配器。作为解析服务器包的一部分,我们提供了一个用于通过 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: '[email protected]',
      // 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: '[email protected]',
        // Your domain from mailgun.com
        domain: 'example.com',
        // Your API key from mailgun.com
        apiKey: 'key-mykey',
        }
    }
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

解析开源服务器重置密码错误 的相关文章

随机推荐

  • PrintServerException - “...名称无效”,即使我可以从 Windows 访问路径

    类似于以下的行引发了上述异常 PrintServer ps new PrintServer prntsrv 当我在 Windows 上使用 运行 时 上面的地址确实有效 并将我带到打印作业列表 那么为什么该行代码不起作用 显然 地址 prn
  • 类型错误:[API] 在内容脚本中未定义或为什么我不能在内容脚本中执行此操作?

    我试图在 Firefox 中编写一个简单的扩展 其中我修改了X Frame Allow header 我简单地查看了文档 发现它们支持webRequest onHeadersReceived addListener 但是 当收到标头时 我无
  • 带 Alpha 通道的颜色的十六进制表示?

    对于如何以十六进制格式表示颜色 包括 Alpha 通道 是否有 W3 或任何其他值得注意的标准 是 RGBA 还是 ARGB 在 CSS 3 中 引用规范 RGBA 值没有十六进制表示法 请参阅CSS Level 3 规范 相反 您可以使用
  • 是否可以在 Flash 或 Flex 中存储 cookie 的值?

    在PHP中有一个setcookie基于函数来存储它 在Flash中可以吗 如果可以的话怎么办 我想储存价值 首先 PHP 运行在服务器上 因此可以发送必要的 HTTP 标头来设置 cookie Flash 运行在客户端浏览器中 因此不能执行
  • 如何在主应用程序中合并 Rails Engine ApplicationController 方法?

    如何将 Rails 引擎 ApplicationController 它的方法 合并到主应用程序中 我需要访问这些引擎控制器方法 并且我想在不使用主应用程序的 ApplicationController 中的 包含 的情况下执行此操作 mo
  • 如何使用 AngularJS 限制输入值?

    我正在寻找将输入内的值限制为 4 并将 4 位数字值处理到我的控制器的方法
  • 捕获 FileSystemWatcher 侦听器线程抛出的异常

    我正在尝试找出一种方法来捕获抛出的异常FileSystemWatcher正如我从软件的崩溃报告日志中注意到的那样 这些似乎是随机发生的 崩溃并不频繁 因为上个月只发生了两次 但很烦人 我很想修复它 有问题的异常似乎与路径中包含无效字符的文件
  • C# 代码无法“查看”我的 C++ dll 中的方法

    我有一段用 C 编写的代码 不是我写的 并且想在 C 中使用它 所以我决定制作一个 dll 并从那里使用这个类 我对 C 的了解很少 并且在我的 C 项目中引用此类的方法时遇到问题 C 代码是这样的 ifndef BeamAn class
  • 使用 jQuery 更改 URL 和重定向

    我有一些这样的代码
  • PCA 中第一个分量覆盖的 99% 方差的显着性

    当第一个分量覆盖 PCA 分析中总方差的 99 以上时 这意味着什么 我有一个大小为 500X1000 的特征向量 我在其中使用了 Matlab 的 pca 函数 该函数返回 coeff score latent tsquared expl
  • Android OpenGL ES 透明背景

    我正在构建一个利用 OpenGL 的 Android 应用程序 就目前而言 本次活动的背景GLSurfaceView由我的代码动态生成并作为纹理加载并用glDrawTexfOES 这是 好的 但我可以简单地将图像更平滑地显示到其自己的表面
  • Mediacodec 解码器在解码 H264 文件时总是超时

    我一直在努力decode编码的视频文件H264编码与安卓的媒体编解码器并尝试将解码器的输出放入surface 但是当我运行应用程序时 它显示黑色表面 并且在 DDMS logcat 中我看到解码器超时 我已将文件解析为有效frames首先
  • Jmeter 中突发模式的负载测试

    我正在运行 1 小时的负载测试 在测试之间我希望场景以 15 分钟的固定间隔运行 1 分钟的持续时间 在jmeter中 目前我可以模拟除突发模式之外的所有其他场景 如何保持延迟15分钟并触发持续1分钟的请求 如何达到突发的TPS 目前我必须
  • 如何将 HH:mm:ss.SSS 转换为毫秒?

    我有一个字符串00 01 30 500这相当于90500毫秒 我尝试使用SimpleDateFormat给出包括当前日期在内的毫秒数 我只需要毫秒级的字符串表示形式 我是否必须编写自定义方法来分割并计算毫秒 或者还有其他方法可以做到这一点吗
  • 在php中获取memcache项的过期时间?

    我在我的网站上缓存推文 过期时间为 30 分钟 当缓存为空时 第一个找到的用户将重新填充它 然而 那时 Twitter API 可能会返回 200 在这种情况下 我想将之前的数据再延长 30 分钟 但之前的数据已经丢失了 因此 我想考虑在过
  • 在 UITableViewController 中弹出多个级别

    我希望能够从 UITableViewController 堆栈中弹出多个视图 例如 在 Apple DrillDownSave 示例中 当查看级别 3 时返回级别 1 或者当查看项目时按按钮返回级别 2 我试过 self navigatio
  • 值为 Empty 的 Variant 类型的变量如何在堆栈上表示?

    以下解释来自Rhino 开发者文档 Empty 当您在 VBScript 中声明变量时 变量的值之前 第一个赋值未定义 或者Empty Dim varValue Empty value 所以基本上 Empty说 我是一个未初始化的变体 如果
  • `int 3` 到底应该做什么?

    根据this int 3从用户空间使用来生成 SIGTRAP 但是 在用户空间下的特权下应该做什么呢 还有更多的东西可以从用户空间 SIGTRAP 生成这样的东西吗 操作码int 3对 UNIX 约定一无所知 例如 SIGTRAP Int
  • 获取Windows 8自动颜色主题的活动颜色

    在 Windows 8 中 我已将配色方案设置为自动 并将壁纸配置为在 x 分钟后更改 配色方案根据活动壁纸而变化 我正在开发一个 WPF 应用程序 并且希望在 Windows 更改配色方案以匹配当前壁纸时更改我的渐变 有没有办法获取当前
  • 解析开源服务器重置密码错误

    I updated the parse server to run on AWS and I get this error when I hit the reset password but the login works I am not