@sumaris-net/ngx-components 2.4.82-rc3 → 2.4.82-rc4

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.
@@ -11688,12 +11688,10 @@ const environment = Object.freeze({
11688
11688
  helpUrl: 'https://gitlab.ifremer.fr/sih-public/sumaris/sumaris-doc/-/blob/master/user-manual/index_fr.md',
11689
11689
  // Development
11690
11690
  defaultAuthValues: {
11691
- // Basic auth (using Person.username)
11692
- // username: 'admq2', password: 'q22006'
11693
- // Token auth (using Person.pubkey)
11694
- //username: 'admin@sumaris.net', password: 'admin',
11695
- username: 'lpecquot',
11696
- pubkey: 'GEj5KLU3NoHPEW7hEmrbTc3srqnGgtr7KehAt8YVbsbP', token: 'GEj5KLU3NoHPEW7hEmrbTc3srqnGgtr7KehAt8YVbsbP:9C4B3A4560F52BDB1E3DACDEC973C077AE7A8FE8E005F3683BE52ADC718BC818|Jktzj/MYewXGWSIbw+MXq0QgzzduSat0ODsgHpDLRonxfipReplp2Y9xPUfsCD6Y1cEvW4JxNtHIsi7c7GOWAA=='
11691
+ // Basic auth (using Person.username)
11692
+ // username: 'admq2', password: 'q22006'
11693
+ // Token auth (using Person.pubkey)
11694
+ //username: 'admin@sumaris.net', password: 'admin',
11697
11695
  },
11698
11696
  account: {
11699
11697
  enableListenChanges: true,
@@ -18237,10 +18235,10 @@ class AccountService extends BaseGraphqlService {
18237
18235
  let pubkey = values[0];
18238
18236
  let token = values[1];
18239
18237
  const seckey = values[2];
18240
- // DEV only - restore pubkey/token
18238
+ // DEV only - auth by token
18241
18239
  if (!this.environment.production && ((_a = this.environment.defaultAuthValues) === null || _a === void 0 ? void 0 : _a.token)) {
18242
18240
  token = token || this.environment.defaultAuthValues.token;
18243
- pubkey = pubkey || this.environment.defaultAuthValues.pubkey || (token === null || token === void 0 ? void 0 : token.split(':')[0]);
18241
+ pubkey = pubkey || (token === null || token === void 0 ? void 0 : token.split(':', 2)[0]);
18244
18242
  }
18245
18243
  // Quit if no pubkey (not logged)
18246
18244
  if (!pubkey)
@@ -18288,6 +18286,7 @@ class AccountService extends BaseGraphqlService {
18288
18286
  }
18289
18287
  // Invalid account: do not use it
18290
18288
  if (!jsonAccount || jsonAccount.pubkey !== pubkey) {
18289
+ // DEV only: create a fake account with given username
18291
18290
  if (!this.environment.production && this.environment.defaultAuthValues.username) {
18292
18291
  const username = this.environment.defaultAuthValues.username;
18293
18292
  jsonAccount = { pubkey, username, firstName: username, lastName: username };