@genesislcap/foundation-login 14.67.3 → 14.67.5-alpha-9eca81b.0

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":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAiB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAwB,MAAM,4BAA4B,CAAC;AAG7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AACH,qBACa,KAAM,SAAQ,WAAW;IACpC;;;;;OAKG;IACuB,MAAM,EAAG,gBAAgB,CAAC;IAEpD;;;OAGG;IACQ,SAAS,EAAG,SAAS,CAAC;IAEjC;;;OAGG;IACM,OAAO,EAAG,OAAO,CAAC;IAE3B;;;OAGG;IACS,KAAK,EAAE,OAAO,CAAS;IAEnC;;;OAGG;IACS,QAAQ,EAAG,WAAW,CAAC;IAEnC;;OAEG;IACG,iBAAiB;IAOvB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,gBAAgB;IAchB;;;OAGG;IACG,wBAAwB;IAa9B;;OAEG;IACH,SAAS,CAAC,sBAAsB;CAgBjC;AAED;;;;;GAKG;AACH,qBAIa,WAAY,SAAQ,KAAK;IAC9B,wBAAwB;CAG/B"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,EAAiB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE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ACP,OAAO,CAAC,SAAS;IACP,OAAO,CAAC,SAAS;IAC7B,OAAO,CAAC,OAAO;IACD,OAAO,CAAC,WAAW;gBAJ5B,IAAI,EAAE,IAAI,EACL,SAAS,EAAE,SAAS,EACV,SAAS,EAAE,mBAAmB,EAC1C,OAAO,EAAE,OAAO,EACF,WAAW,cAAqB;IAK1D,SAAS;IA8IT,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;CAG/C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/routes/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EACP,mBAAmB,EAGpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAY,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAA2B,mBAAmB,EAAS,MAAM,wBAAwB,CAAC;AAE7F,OAAO,EAAsB,WAAW,EAAE,MAAM,SAAS,CAAC;AAQ1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGxC;;;;;;;;;GASG;AACH,qBAAa,gBAAiB,SAAQ,mBAAmB,CAAC,QAAQ,CAAC;IAEzD,OAAO,CAAC,IAAI;IACP,OAAO,CAAC,SAAS;IACP,OAAO,CAAC,SAAS;IAC7B,OAAO,CAAC,OAAO;IACD,OAAO,CAAC,WAAW;gBAJ5B,IAAI,EAAE,IAAI,EACL,SAAS,EAAE,SAAS,EACV,SAAS,EAAE,mBAAmB,EAC1C,OAAO,EAAE,OAAO,EACF,WAAW,cAAqB;IAK1D,SAAS;IA+IT,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;CAG/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"m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AAO,CAAC,iBAAiB;IAczB,iBAAiB;IAiBjB,IACI,eAAe,WAElB;IAED,OAAO,CAAC,SAAS,CAUf;IAEF,cAAc,MAAO,WAAW,KAAG,IAAI,CAIrC;IAEF,UAAU;IAiBV,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAQhB,YAAY;IAIZ,aAAa;IAOb,KAAK,CAAC,WAAW,EAAE,QAAQ;IAwCjC,IACI,iBAAiB,6BAEpB;IAED,IAAI,qBAAqB,YAExB;IAED,IAAI,cAAc,YAEjB;CACF"}
@@ -5,6 +5,7 @@ import { Container, inject, Registration } from '@microsoft/fast-foundation';
5
5
  import { DefaultRouteRecognizer } from '@microsoft/fast-router';
6
6
  import * as Components from '../components';
7
7
  import { MainRouterConfig } from '../routes';
8
+ import { logger } from '../utils';
8
9
  import { definition, standaloneDefinition } from './main.definition';
9
10
  /**
10
11
  * Defines the login class which handles account authentication from the front-end
@@ -125,6 +126,7 @@ let Login = class Login extends FASTElement {
125
126
  return __awaiter(this, void 0, void 0, function* () {
126
127
  this.registerDIDependencies();
127
128
  _super.connectedCallback.call(this);
129
+ logger.debug('Login connected to the DOM');
128
130
  yield this.registerCommonComponents();
129
131
  this.checkForSSOToken();
130
132
  });
@@ -154,6 +156,7 @@ let Login = class Login extends FASTElement {
154
156
  checkForSSOToken() {
155
157
  const queryParams = new URLSearchParams(window.location.search);
156
158
  const ssoToken = queryParams.get('SSO_TOKEN');
159
+ logger.debug('Checking for SSO token', { queryParams, ssoToken });
157
160
  if (ssoToken) {
158
161
  if (window.opener) {
159
162
  window.opener.sessionStorage.setItem('ssoToken', ssoToken);
@@ -4,6 +4,7 @@ import { Container, optional } from '@microsoft/fast-foundation';
4
4
  import { RouterConfiguration, Route } from '@microsoft/fast-router';
5
5
  import { defaultLayout } from '../layouts';
6
6
  import { defaultLoginConfig, LoginConfig } from '../main';
7
+ import { logger } from '../utils';
7
8
  import { ForgotPassword } from './forgot-password/forgot-password';
8
9
  import { LoginForm } from './login-form/login-form';
9
10
  import { NotFound } from './not-found/not-found';
@@ -119,6 +120,7 @@ let MainRouterConfig = class MainRouterConfig extends RouterConfiguration {
119
120
  this.contributors.push({
120
121
  navigate: (phase) => __awaiter(this, void 0, void 0, function* () {
121
122
  const settings = phase.route.settings;
123
+ logger.debug('Login route change', phase.route.endpoint.path, phase);
122
124
  /**
123
125
  * TODO: Centralise
124
126
  * Suspect this should be done via createEventSink, but it's not fully clear how-to do that as no docs
@@ -16,6 +16,7 @@ let LoginForm = class LoginForm extends BaseRoute {
16
16
  this.fetchIDPs = () => __awaiter(this, void 0, void 0, function* () {
17
17
  var _a, _b;
18
18
  const ipdsEndpoint = `${(_b = (_a = this.config.sso) === null || _a === void 0 ? void 0 : _a.identityProvidersPath) !== null && _b !== void 0 ? _b : 'sso/list'}`;
19
+ logger.debug(`Fetching IDPS from ${ipdsEndpoint}`);
19
20
  return fetch(ipdsEndpoint)
20
21
  .then((res) => {
21
22
  if (res.ok)
@@ -40,12 +41,19 @@ let LoginForm = class LoginForm extends BaseRoute {
40
41
  return __awaiter(this, void 0, void 0, function* () {
41
42
  _super.connectedCallback.call(this);
42
43
  this.ssoToggled = (_b = (_a = this.config.sso) === null || _a === void 0 ? void 0 : _a.toggled) !== null && _b !== void 0 ? _b : false;
44
+ logger.debug('Login form connected to the DOM', {
45
+ ssoToggled: this.ssoToggled,
46
+ isConnected: this.isConnected,
47
+ isLoggedIn: this.auth.isLoggedIn,
48
+ });
43
49
  if (this.connect.isConnected && this.auth.isLoggedIn) {
44
50
  yield this.credentialManager.preventSilentAccess();
45
51
  yield this.auth.logout();
46
52
  }
47
53
  this.convertHostUrl();
48
- yield this.autofill();
54
+ if (!this.ssoToggled) {
55
+ yield this.autofill();
56
+ }
49
57
  });
50
58
  }
51
59
  enter() {
@@ -67,6 +75,7 @@ let LoginForm = class LoginForm extends BaseRoute {
67
75
  }
68
76
  toggleConnection() {
69
77
  return __awaiter(this, void 0, void 0, function* () {
78
+ logger.debug('Login form - toggleConnection', { isConnected: this.connect.isConnected });
70
79
  if (this.connect.isConnected) {
71
80
  this.connect.disconnect();
72
81
  logger.debug(`Disconnected from ${this.host}`);
@@ -78,6 +87,7 @@ let LoginForm = class LoginForm extends BaseRoute {
78
87
  attemptLoginWhenConnected() {
79
88
  this.connect.isConnectedSubject.subscribe((isConnected) => {
80
89
  if (isConnected) {
90
+ logger.debug('Login form - attemptLoginWhenConnected');
81
91
  /**
82
92
  * Login preference flow taken from @genesislcap/foundation-login.
83
93
  * We should sit down with Jose and team to cross check this. Reference code is bit hard to follow in places.
@@ -92,12 +102,13 @@ let LoginForm = class LoginForm extends BaseRoute {
92
102
  if (this.ssoToggled) {
93
103
  const ssoCredentials = cm.createSSOCredentials();
94
104
  if (cm.validateSSOCredentials(ssoCredentials)) {
95
- logger.debug(`Attempting to login with SSO.`);
105
+ logger.debug(`Attempting to login with SSO.`, ssoCredentials);
96
106
  this.login(ssoCredentials);
97
107
  this.credentialManager.removeSSOToken(); // < sso tokens can only be used once, remove after login attempt
98
108
  return;
99
109
  }
100
110
  }
111
+ logger.debug(`Attempting basic login`);
101
112
  this.attemptBasicLogin();
102
113
  }
103
114
  });
@@ -115,6 +126,7 @@ let LoginForm = class LoginForm extends BaseRoute {
115
126
  this.login(basicCredentials);
116
127
  }
117
128
  ssoToggledChanged() {
129
+ logger.debug(`SSO Toggle changed`, { ssoToggled: this.ssoToggled });
118
130
  this.clearError();
119
131
  if (this.ssoToggled) {
120
132
  this.fetchIDPs()
@@ -135,6 +147,7 @@ let LoginForm = class LoginForm extends BaseRoute {
135
147
  }
136
148
  onClickSSO() {
137
149
  const ssoLoginUrl = this.createLoginURL();
150
+ logger.debug(`Starting SSO login`, { ssoLoginUrl });
138
151
  if (inIFrame()) {
139
152
  if (inSymphonyDesktop()) {
140
153
  // symphony/electron opens new window in the default browser instead
@@ -183,16 +196,19 @@ let LoginForm = class LoginForm extends BaseRoute {
183
196
  login(credentials) {
184
197
  return __awaiter(this, void 0, void 0, function* () {
185
198
  try {
199
+ logger.debug(`Starting login`, { credentials });
186
200
  const { authToken } = yield this.auth.login(credentials);
187
201
  if (!authToken) {
188
202
  throw new Error('Unable to login. Try again later.');
189
203
  }
204
+ logger.debug(`Auth token received`, { authToken });
190
205
  this.storeCredentials();
191
206
  let url = this.config.defaultRedirectUrl;
192
207
  if (this.session.returnUrl &&
193
208
  !this.config.omitRedirectUrls.includes(this.session.returnUrl)) {
194
209
  url = this.session.returnUrl;
195
210
  }
211
+ logger.debug(`Redirecting back to ${url}`);
196
212
  Route.path.push(url);
197
213
  }
198
214
  catch (err) {
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.67.3",
4
+ "version": "14.67.5-alpha-9eca81b.0",
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.67.3",
53
- "@genesislcap/genx": "14.67.3",
52
+ "@genesislcap/foundation-testing": "14.67.5-alpha-9eca81b.0",
53
+ "@genesislcap/genx": "14.67.5-alpha-9eca81b.0",
54
54
  "rimraf": "^3.0.2"
55
55
  },
56
56
  "dependencies": {
57
- "@genesislcap/foundation-comms": "14.67.3",
58
- "@genesislcap/foundation-ui": "14.67.3",
59
- "@genesislcap/foundation-utils": "14.67.3",
60
- "@genesislcap/foundation-zero": "14.67.3",
57
+ "@genesislcap/foundation-comms": "14.67.5-alpha-9eca81b.0",
58
+ "@genesislcap/foundation-ui": "14.67.5-alpha-9eca81b.0",
59
+ "@genesislcap/foundation-utils": "14.67.5-alpha-9eca81b.0",
60
+ "@genesislcap/foundation-zero": "14.67.5-alpha-9eca81b.0",
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": "c966344d844d58c44dc9963214ed68bfd24abe65"
77
+ "gitHead": "f97e5e298667e0bd0b668a04a29b53adaa783cc6"
78
78
  }