Check valid social account provider

This commit is contained in:
Luis Fernando Molina committed 2018-09-11 10:50:38 +02:00
1 parent 1d0a4b82ec
commit 00073c8646
2 files changed
+15

No files matched your search

+1
View File
@@ -135,6 +135,7 @@ console.log("component will UNmount");
if (this.defaultValuesSet === false)
{
let user = JSON.parse(localStorage.getItem("loggedInUser"));
console.log("user", user);
this.defaultValuesSet= true;
this.refs.firstName.value = user.alias;
console.log("setting defaults");
+14
View File
@@ -360,6 +360,20 @@ try {
*/
/* The user can sign up with many different possible social accounts. Currently this module only supports Github only. */
let authArray = authId.split("|");
let socialAccountProvider = authArray[0];
if(socialAccountProvider !== 'github') {
if (global.ERROR_LOG === true) { console.log("[ERROR] " + MODULE_NAME + " -> authenticate -> onValidated -> onUserFound -> Social Account Provider not Supoorted. "); }
if (global.ERROR_LOG === true) { console.log("[ERROR] " + MODULE_NAME + " -> authenticate -> onValidated -> onUserFound -> socialAccountProvider = " + socialAccountProvider); }
callBackFunction(global.DEFAULT_FAIL_RESPONSE, { error: err });
return;
}
let newUser = new User({
alias: alias,
authId: authId,