Created
February 19, 2018 19:02
-
-
Save max-berman/a0c12f76ff255ab16521f5f9d96253f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
errorHandler = error => { | |
console.log("Error occurred: %o", error) | |
} | |
linkCustomId = () => { | |
const message = new nakamajs.LinkRequest() | |
message.custom = Cookies.get('custom_ID') | |
return this.client.send(message) | |
.then (session => { | |
console.log("Successfully linked custom ID to current user.") | |
}).catch(this.errorHandler) | |
} | |
unLinkCustomId = () => { | |
const message = new nakamajs.UnlinkRequest() | |
message.custom = Cookies.get('custom_ID') | |
this.client.send(message) | |
.then (session => { | |
console.log("Successfully unlinked custom ID to current user.") | |
}).catch(this.errorHandler) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment