mario-core 1.2.25-es-release → 1.2.25-es-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +63 -33
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +63 -33
- package/dist/index.modern.js.map +1 -1
- package/dist/services/accountService.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -22447,6 +22447,9 @@ var getGoogleClientId = function getGoogleClientId() {
|
|
|
22447
22447
|
var registerUserStudent = function registerUserStudent(body) {
|
|
22448
22448
|
return api.post(BASE_URL + "/api/User/register-user", body);
|
|
22449
22449
|
};
|
|
22450
|
+
var AccountSSOLogApi = function AccountSSOLogApi(data) {
|
|
22451
|
+
return api.post(ACCOUNT_URL + "/account-sso-log", data);
|
|
22452
|
+
};
|
|
22450
22453
|
|
|
22451
22454
|
var TypeLogin;
|
|
22452
22455
|
|
|
@@ -23136,42 +23139,69 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
23136
23139
|
}
|
|
23137
23140
|
}, [executeRecaptcha]);
|
|
23138
23141
|
var handleVerify = React.useCallback(function () {}, []);
|
|
23139
|
-
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
+
|
|
23143
|
+
var logGoogleLoginFail = function logGoogleLoginFail(err) {
|
|
23144
|
+
try {
|
|
23145
|
+
var _temp2 = _catch(function () {
|
|
23146
|
+
return Promise.resolve(AccountSSOLogApi(err)).then(function () {});
|
|
23147
|
+
}, function (error) {
|
|
23148
|
+
console.error(error);
|
|
23149
|
+
});
|
|
23150
|
+
|
|
23151
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
23152
|
+
} catch (e) {
|
|
23153
|
+
return Promise.reject(e);
|
|
23154
|
+
}
|
|
23155
|
+
};
|
|
23142
23156
|
|
|
23143
23157
|
var onSuccessGoogle = function onSuccessGoogle(res) {
|
|
23144
|
-
|
|
23145
|
-
var
|
|
23146
|
-
|
|
23147
|
-
|
|
23148
|
-
|
|
23149
|
-
|
|
23150
|
-
|
|
23151
|
-
|
|
23152
|
-
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
|
|
23160
|
-
|
|
23161
|
-
|
|
23162
|
-
|
|
23158
|
+
try {
|
|
23159
|
+
var _exit2 = false;
|
|
23160
|
+
return Promise.resolve(function () {
|
|
23161
|
+
if (!!(res !== null && res !== void 0 && res.accessToken)) {
|
|
23162
|
+
var _hostName$split, _hostName$split$, _email$split;
|
|
23163
|
+
|
|
23164
|
+
var _temp5 = function _temp5(_result) {
|
|
23165
|
+
if (_exit2) return _result;
|
|
23166
|
+
var infoLogin = {
|
|
23167
|
+
firstName: _givenName,
|
|
23168
|
+
lastName: _familyName,
|
|
23169
|
+
imageUrl: _imageUrl,
|
|
23170
|
+
fullName: _name,
|
|
23171
|
+
email: _email,
|
|
23172
|
+
accessToken: _accessToken,
|
|
23173
|
+
googleId: _googleId
|
|
23174
|
+
};
|
|
23175
|
+
setInfoUser(infoLogin);
|
|
23176
|
+
fnIsCheckLogin(TypeLogin.Google, infoLogin, _accessToken, clickHandler);
|
|
23177
|
+
};
|
|
23178
|
+
|
|
23179
|
+
var _res$profileObj = res.profileObj,
|
|
23180
|
+
_email = _res$profileObj.email,
|
|
23181
|
+
_familyName = _res$profileObj.familyName,
|
|
23182
|
+
_givenName = _res$profileObj.givenName,
|
|
23183
|
+
_imageUrl = _res$profileObj.imageUrl,
|
|
23184
|
+
_name = _res$profileObj.name;
|
|
23185
|
+
var _accessToken = res.accessToken;
|
|
23186
|
+
var _googleId = res.googleId;
|
|
23187
|
+
var hostName = window.location.hostname;
|
|
23188
|
+
var subDomain = hostName === null || hostName === void 0 ? void 0 : (_hostName$split = hostName.split(".marioforme.com")) === null || _hostName$split === void 0 ? void 0 : (_hostName$split$ = _hostName$split[0]) === null || _hostName$split$ === void 0 ? void 0 : _hostName$split$.replace(/-es$|^es-/, "");
|
|
23189
|
+
var emailDomain = (_email$split = _email.split("@")) === null || _email$split === void 0 ? void 0 : _email$split[1];
|
|
23190
|
+
|
|
23191
|
+
var _temp6 = function () {
|
|
23192
|
+
if (!emailDomain.includes(subDomain) && !emailDomain.includes(extensionEmail)) {
|
|
23193
|
+
alert("The email address you used does not match the login information in the database. Please check that you are using your school assigned email address to log into MARIO for Me. If you have further trouble please notify your school site administrator");
|
|
23194
|
+
return Promise.resolve(logGoogleLoginFail([emailDomain + " is incorrect"])).then(function () {
|
|
23195
|
+
_exit2 = true;
|
|
23196
|
+
});
|
|
23197
|
+
}
|
|
23198
|
+
}();
|
|
23163
23199
|
|
|
23164
|
-
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23168
|
-
|
|
23169
|
-
email: email,
|
|
23170
|
-
accessToken: accessToken,
|
|
23171
|
-
googleId: googleId
|
|
23172
|
-
};
|
|
23173
|
-
setInfoUser(infoLogin);
|
|
23174
|
-
fnIsCheckLogin(TypeLogin.Google, infoLogin, accessToken, clickHandler);
|
|
23200
|
+
return _temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6);
|
|
23201
|
+
}
|
|
23202
|
+
}());
|
|
23203
|
+
} catch (e) {
|
|
23204
|
+
return Promise.reject(e);
|
|
23175
23205
|
}
|
|
23176
23206
|
};
|
|
23177
23207
|
|