@genesislcap/foundation-login 14.78.0-mfa-auth.1 → 14.78.0-mfa-auth.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B,qBAKa,SAAU,SAAQ,SAAS;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAM;IACjB,WAAW,EAAE,MAAM,CAAM;IACzB,UAAU,EAAE,OAAO,CAAS;IAElC,iBAAiB;IAejB,KAAK;
|
|
1
|
+
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B,qBAKa,SAAU,SAAQ,SAAS;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAM;IACjB,WAAW,EAAE,MAAM,CAAM;IACzB,UAAU,EAAE,OAAO,CAAS;IAElC,iBAAiB;IAejB,KAAK;IAqBL,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAStD,OAAO,CAAC,yBAAyB;IAiDjC,OAAO,CAAC,iBAAiB;IAkBzB,iBAAiB;IAmBjB,IACI,eAAe,WAElB;IAED,cAAc,MAAO,WAAW,KAAG,IAAI,CAIrC;IAEF,UAAU;IAiBV,OAAO,CAAC,cAAc;IAQhB,YAAY;IAIZ,aAAa;IAOb,KAAK,CAAC,WAAW,EAAE,QAAQ;IA4CjC,IACI,iBAAiB,6BAEpB;IAED,IAAI,qBAAqB,YAExB;IAED,IAAI,cAAc,YAEjB;CACF"}
|
|
@@ -40,6 +40,11 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
40
40
|
}
|
|
41
41
|
enter() {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const queryParams = new URLSearchParams(window.location.search);
|
|
44
|
+
const mfaToken = queryParams.get('MFA_CODE');
|
|
45
|
+
if (mfaToken) {
|
|
46
|
+
this.session.setSessionStorageItem('mfaToken', mfaToken);
|
|
47
|
+
}
|
|
43
48
|
DOM.queueUpdate(() => __awaiter(this, void 0, void 0, function* () {
|
|
44
49
|
try {
|
|
45
50
|
if (!this.connect.isConnected && this.config.autoConnect) {
|
|
@@ -88,37 +93,43 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
88
93
|
return;
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
96
|
+
// TODO: temporarly disable this approach because server expect username and pass when logging in with mfa
|
|
97
|
+
// const queryParams = new URLSearchParams(window.location.search);
|
|
98
|
+
//
|
|
99
|
+
// const mfaToken = queryParams.get('MFA_CODE');
|
|
100
|
+
// if (mfaToken) {
|
|
101
|
+
// const mfaCredentials = cm.createMFACredentials({
|
|
102
|
+
// /**
|
|
103
|
+
// * I think `token` is better as it's system gen vs code a user entered
|
|
104
|
+
// * TODO: Get server guys to update query param to MFA_TOKEN
|
|
105
|
+
// */
|
|
106
|
+
// mfaToken,
|
|
107
|
+
// });
|
|
108
|
+
// if (cm.validateMFACredentials(mfaCredentials)) {
|
|
109
|
+
// logger.debug(`Attempting to login with mfa credentials.`);
|
|
110
|
+
// this.login(mfaCredentials);
|
|
111
|
+
// return;
|
|
112
|
+
// }
|
|
113
|
+
// }
|
|
107
114
|
this.attemptBasicLogin();
|
|
108
115
|
}
|
|
109
116
|
});
|
|
110
117
|
}
|
|
111
118
|
attemptBasicLogin() {
|
|
119
|
+
const mfaToken = window.sessionStorage.getItem('mfa');
|
|
112
120
|
const basicCredentials = this.credentialManager.createBasicCredentials({
|
|
113
121
|
username: this.orgUsername,
|
|
114
122
|
password: this.password,
|
|
123
|
+
mfaToken: mfaToken,
|
|
115
124
|
});
|
|
116
125
|
if (!this.credentialManager.validateBasicCredentials(basicCredentials)) {
|
|
117
126
|
logger.debug(`Basic credentials appear invalid, aborting login attempt.`);
|
|
118
127
|
return;
|
|
119
128
|
}
|
|
120
129
|
logger.debug(`Attempting to login with basic credentials.`);
|
|
121
|
-
this.login(basicCredentials)
|
|
130
|
+
this.login(basicCredentials).then(() => {
|
|
131
|
+
// window.sessionStorage.removeItem('mfa'); // TODO: check later
|
|
132
|
+
});
|
|
122
133
|
}
|
|
123
134
|
ssoToggledChanged() {
|
|
124
135
|
var _a, _b;
|
|
@@ -209,6 +220,9 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
209
220
|
return;
|
|
210
221
|
}
|
|
211
222
|
if (err.hasMFAError()) {
|
|
223
|
+
this.storeCredentials();
|
|
224
|
+
this.session.setSessionStorageItem('refreshToken', err.received.REFRESH_AUTH_TOKEN);
|
|
225
|
+
this.session.setSessionStorageItem('username', this.username);
|
|
212
226
|
this.setError('Please check your inbox for your login link.');
|
|
213
227
|
return;
|
|
214
228
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-login",
|
|
3
3
|
"description": "Genesis Foundation Login",
|
|
4
|
-
"version": "14.78.0-mfa-auth.
|
|
4
|
+
"version": "14.78.0-mfa-auth.8",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/foundation-login.d.ts",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"test:debug": "genx test --debug"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@genesislcap/foundation-testing": "14.78.0-mfa-auth.
|
|
53
|
-
"@genesislcap/genx": "14.78.0-mfa-auth.
|
|
52
|
+
"@genesislcap/foundation-testing": "14.78.0-mfa-auth.8",
|
|
53
|
+
"@genesislcap/genx": "14.78.0-mfa-auth.8",
|
|
54
54
|
"rimraf": "^3.0.2"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@genesislcap/foundation-comms": "14.78.0-mfa-auth.
|
|
58
|
-
"@genesislcap/foundation-ui": "14.78.0-mfa-auth.
|
|
59
|
-
"@genesislcap/foundation-utils": "14.78.0-mfa-auth.
|
|
60
|
-
"@genesislcap/foundation-zero": "14.78.0-mfa-auth.
|
|
57
|
+
"@genesislcap/foundation-comms": "14.78.0-mfa-auth.8",
|
|
58
|
+
"@genesislcap/foundation-ui": "14.78.0-mfa-auth.8",
|
|
59
|
+
"@genesislcap/foundation-utils": "14.78.0-mfa-auth.8",
|
|
60
|
+
"@genesislcap/foundation-zero": "14.78.0-mfa-auth.8",
|
|
61
61
|
"@microsoft/fast-components": "^2.21.3",
|
|
62
62
|
"@microsoft/fast-element": "^1.7.0",
|
|
63
63
|
"@microsoft/fast-foundation": "^2.33.2",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
76
|
"customElements": "dist/custom-elements.json",
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "504bd148c93a4a1071f4ae1a0b89942e470b7351"
|
|
78
78
|
}
|