gpt4 book ai didi

javascript - 使用 Kinvey 自动生成用户

转载 作者:行者123 更新时间:2023-12-03 07:47:21 25 4
gpt4 key购买 nike

使用 Kinvey 有没有办法自动生成用户(如本文档中所示: http://devcenter.kinvey.com/ios/guides/users#autogenerated ),但对于 REST 或 AngularJS ?

最佳答案

自动生成用户基本上是使用电子邮件进行注册,最终创建一个随机的用户名和密码。

可以使用任何 Kinvey SDK 以及 REST:

  1. AngularJS

    var promise = $kinvey.User.signup({
    email : '<user-email>'
    });
    promise.then(function(user) {
    alert('Kinvey User signup Success.');
    }, function(err) {
    alert('Kinvey User signup Failed.');
    });
  2. 休息

POST /user/:appKey/ HTTP/1.1
Host: baas.kinvey.com
Authorization: [Basic Auth with app credentials]
Content-Type: application/json
{"email" : "<user-email>"}

如果您不在 Kinvey 应用的用户设置中强制执行电子邮件验证,则用户电子邮件是可选的。

在这种情况下,您可以使用空正文(即 {})执行 POST 请求。

引用文献:

  1. http://devcenter.kinvey.com/angular/guides/users#signup
  2. http://devcenter.kinvey.com/rest/guides/users#signup

关于javascript - 使用 Kinvey 自动生成用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35148768/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com