Check valid social account provider
This commit is contained in:
1 parent
1d0a4b82ec
commit
00073c8646
2 files changed
+15
No files matched your search
@@ -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");
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user