@genesislcap/foundation-login 14.67.4 → 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,6 +41,11 @@ 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();
@@ -69,6 +75,7 @@ let LoginForm = class LoginForm extends BaseRoute {
69
75
  }
70
76
  toggleConnection() {
71
77
  return __awaiter(this, void 0, void 0, function* () {
78
+ logger.debug('Login form - toggleConnection', { isConnected: this.connect.isConnected });
72
79
  if (this.connect.isConnected) {
73
80
  this.connect.disconnect();
74
81
  logger.debug(`Disconnected from ${this.host}`);
@@ -80,6 +87,7 @@ let LoginForm = class LoginForm extends BaseRoute {
80
87
  attemptLoginWhenConnected() {
81
88
  this.connect.isConnectedSubject.subscribe((isConnected) => {
82
89
  if (isConnected) {
90
+ logger.debug('Login form - attemptLoginWhenConnected');
83
91
  /**
84
92
  * Login preference flow taken from @genesislcap/foundation-login.
85
93
  * We should sit down with Jose and team to cross check this. Reference code is bit hard to follow in places.
@@ -94,12 +102,13 @@ let LoginForm = class LoginForm extends BaseRoute {
94
102
  if (this.ssoToggled) {
95
103
  const ssoCredentials = cm.createSSOCredentials();
96
104
  if (cm.validateSSOCredentials(ssoCredentials)) {
97
- logger.debug(`Attempting to login with SSO.`);
105
+ logger.debug(`Attempting to login with SSO.`, ssoCredentials);
98
106
  this.login(ssoCredentials);
99
107
  this.credentialManager.removeSSOToken(); // < sso tokens can only be used once, remove after login attempt
100
108
  return;
101
109
  }
102
110
  }
111
+ logger.debug(`Attempting basic login`);
103
112
  this.attemptBasicLogin();
104
113
  }
105
114
  });
@@ -117,6 +126,7 @@ let LoginForm = class LoginForm extends BaseRoute {
117
126
  this.login(basicCredentials);
118
127
  }
119
128
  ssoToggledChanged() {
129
+ logger.debug(`SSO Toggle changed`, { ssoToggled: this.ssoToggled });
120
130
  this.clearError();
121
131
  if (this.ssoToggled) {
122
132
  this.fetchIDPs()
@@ -137,6 +147,7 @@ let LoginForm = class LoginForm extends BaseRoute {
137
147
  }
138
148
  onClickSSO() {
139
149
  const ssoLoginUrl = this.createLoginURL();
150
+ logger.debug(`Starting SSO login`, { ssoLoginUrl });
140
151
  if (inIFrame()) {
141
152
  if (inSymphonyDesktop()) {
142
153
  // symphony/electron opens new window in the default browser instead
@@ -185,16 +196,19 @@ let LoginForm = class LoginForm extends BaseRoute {
185
196
  login(credentials) {
186
197
  return __awaiter(this, void 0, void 0, function* () {
187
198
  try {
199
+ logger.debug(`Starting login`, { credentials });
188
200
  const { authToken } = yield this.auth.login(credentials);
189
201
  if (!authToken) {
190
202
  throw new Error('Unable to login. Try again later.');
191
203
  }
204
+ logger.debug(`Auth token received`, { authToken });
192
205
  this.storeCredentials();
193
206
  let url = this.config.defaultRedirectUrl;
194
207
  if (this.session.returnUrl &&
195
208
  !this.config.omitRedirectUrls.includes(this.session.returnUrl)) {
196
209
  url = this.session.returnUrl;
197
210
  }
211
+ logger.debug(`Redirecting back to ${url}`);
198
212
  Route.path.push(url);
199
213
  }
200
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.4",
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.4",
53
- "@genesislcap/genx": "14.67.4",
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.4",
58
- "@genesislcap/foundation-ui": "14.67.4",
59
- "@genesislcap/foundation-utils": "14.67.4",
60
- "@genesislcap/foundation-zero": "14.67.4",
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": "eb23f6f1dbb32ec8291be9414984ffa73e181b0e"
77
+ "gitHead": "f97e5e298667e0bd0b668a04a29b53adaa783cc6"
78
78
  }