我可以使用以下云功能从云生成令牌
const main = (params) => {
return new Promise(function (resolve, reject) {
request({
url: credentials.oauthServerUrl + '/token',
method: 'POST',
auth: {
username: credentials.clientId,
password: credentials.secret
},
form: {
grant_type: "password",
username: params.uid,
password: params.pwd
}
}, function (error, response, body) {
resolve(response);
})
})
}
我如何在没有 Node.js SDK 和 Express 服务器的情况下使用 App ID sign_up 和 forgot_password 功能。换句话说,我想保持我的应用程序(SPA)无服务器并使用云功能。我已经尝试过,并阅读了解决方案的文档,但到目前为止还没有运气(http 404)。
编辑:我试图调用忘记密码页面但结果是错误的函数(状态代码 400)“缺少重定向”
const main = (params) => {
return new Promise(function (resolve, reject) {
request({
url: credentials.oauthServerUrl + '/forgot_password',
method: 'GET',
form: {
client_id: credentials.clientId,
redirect_uri: "http://www.google.fi"
}
}, function (error, response, body) {
resolve(response);
})
})
}