我的应用程序托管在sashido.io上,该服务器提供Parse Server托管。由于这是必需的,因此我正在尝试为我的应用程序实现Apple SignIn。第一步,我将以下代码添加到我的应用中。 Apple SignIn工作正常,我获得了令牌和ID,但是无法使用此数据创建“解析用户”。这是我的iOS代码:
var authData = [String: String]()
authData["id"] = id
authData["token"] = token
PFUser.logInWithAuthType(inBackground: "apple", authData: authData).continueWith(block: {
task -> Void in
...
})
我已验证authData正确包含ID和令牌。不幸的是,我收到内部服务器错误作为响应{"code":1,"message":"Internal server error."}
[之后,我像这样修改了index.js文件的以下部分,并将其推送到sashido。不幸的是,这没有任何改变,并且我仍然收到内部服务器错误。
var api = new ParseServer(
{
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || 'masterKey',
serverURL: process.env.SERVER_URL || 'http://localhost:' + port + '/1',
// If you change the cloud/main.js to another path
// it wouldn't work on SashiDo :( ... so Don't change this.
cloud: process.env.CLOUD_CODE_MAIN || 'cloud/main.js',
auth: {
apple: {
client_id: process.env.IOS_BUNDLE_ID
}
},
liveQuery: {
classNames: []
},
});