You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server: parse-server version 2.2.9, remote on heroku
Database: remote on mlab
Steps to reproduce
login new user via Facebook with PFFacebookUtils.logInInBackgroundWithReadPermissions.
retrieve the email address from the user's Facebook profile and set it as the user's email.
given that the email address is already taken by an existing user the save attempt fails with error
setting the user's email address to nil and trying again to save it results in error _this7.data.email.match is not a function (Code: 0, Version: 1.13.0)
subsequently, all following attempts to save PFUser.currentUser() fail with the error above. When not setting the email property to nil all subsequent attempts fail with error PFErrorCode.ErrorUserEmailTaken.
PFFacebookUtils.logInInBackgroundWithReadPermissions(permissions) {
(user: PFUser?, error: NSError?) in
guard let user = user else {
return
}
FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "email"]).startWithCompletionHandler() {
(connection: FBSDKGraphRequestConnection!, result: AnyObject?, error: NSError?) in
guard let result = result where error == nil else {
return
}
let email = result.valueForKey("email") as? String
user.email = email
user.saveInBackgroundWithBlock() {
(succeeded: Bool, error: NSError?) in
if let error = error where error.code == PFErrorCode.ErrorUserEmailTaken.rawValue {
user.email = nil
user.saveInBackground()
}
}
}
}
Is this a bug on the server side?
How can the PFUser.currentUser().email property be reset?
Update .removeObjectForKey("email") instead of setting the .email = nil leads to error {"code":1,"message":"Internal server error."} (Code: 1, Version: 1.13.0)
The text was updated successfully, but these errors were encountered:
Environment Setup
Steps to reproduce
PFFacebookUtils.logInInBackgroundWithReadPermissions
.user
's email._this7.data.email.match is not a function (Code: 0, Version: 1.13.0)
PFErrorCode.ErrorUserEmailTaken
.Is this a bug on the server side?
How can the
PFUser.currentUser().email
property be reset?Update
.removeObjectForKey("email")
instead of setting the.email = nil
leads to error{"code":1,"message":"Internal server error."} (Code: 1, Version: 1.13.0)
The text was updated successfully, but these errors were encountered: