@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.
- package/esm2020/src/app/core/services/account.service.mjs +4 -3
- package/esm2020/src/environments/environment.class.mjs +1 -1
- package/esm2020/src/environments/environment.mjs +5 -7
- package/fesm2015/sumaris-net.ngx-components.mjs +7 -8
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +7 -8
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/environments/environment.class.d.ts +0 -1
|
@@ -11642,12 +11642,10 @@ const environment = Object.freeze({
|
|
|
11642
11642
|
helpUrl: 'https://gitlab.ifremer.fr/sih-public/sumaris/sumaris-doc/-/blob/master/user-manual/index_fr.md',
|
|
11643
11643
|
// Development
|
|
11644
11644
|
defaultAuthValues: {
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
username: 'lpecquot',
|
|
11650
|
-
pubkey: 'GEj5KLU3NoHPEW7hEmrbTc3srqnGgtr7KehAt8YVbsbP', token: 'GEj5KLU3NoHPEW7hEmrbTc3srqnGgtr7KehAt8YVbsbP:9C4B3A4560F52BDB1E3DACDEC973C077AE7A8FE8E005F3683BE52ADC718BC818|Jktzj/MYewXGWSIbw+MXq0QgzzduSat0ODsgHpDLRonxfipReplp2Y9xPUfsCD6Y1cEvW4JxNtHIsi7c7GOWAA=='
|
|
11645
|
+
// Basic auth (using Person.username)
|
|
11646
|
+
// username: 'admq2', password: 'q22006'
|
|
11647
|
+
// Token auth (using Person.pubkey)
|
|
11648
|
+
//username: 'admin@sumaris.net', password: 'admin',
|
|
11651
11649
|
},
|
|
11652
11650
|
account: {
|
|
11653
11651
|
enableListenChanges: true,
|
|
@@ -17991,10 +17989,10 @@ class AccountService extends BaseGraphqlService {
|
|
|
17991
17989
|
let pubkey = values[0];
|
|
17992
17990
|
let token = values[1];
|
|
17993
17991
|
const seckey = values[2];
|
|
17994
|
-
// DEV only -
|
|
17992
|
+
// DEV only - auth by token
|
|
17995
17993
|
if (!this.environment.production && this.environment.defaultAuthValues?.token) {
|
|
17996
17994
|
token = token || this.environment.defaultAuthValues.token;
|
|
17997
|
-
pubkey = pubkey ||
|
|
17995
|
+
pubkey = pubkey || token?.split(':', 2)[0];
|
|
17998
17996
|
}
|
|
17999
17997
|
// Quit if no pubkey (not logged)
|
|
18000
17998
|
if (!pubkey)
|
|
@@ -18042,6 +18040,7 @@ class AccountService extends BaseGraphqlService {
|
|
|
18042
18040
|
}
|
|
18043
18041
|
// Invalid account: do not use it
|
|
18044
18042
|
if (!jsonAccount || jsonAccount.pubkey !== pubkey) {
|
|
18043
|
+
// DEV only: create a fake account with given username
|
|
18045
18044
|
if (!this.environment.production && this.environment.defaultAuthValues.username) {
|
|
18046
18045
|
const username = this.environment.defaultAuthValues.username;
|
|
18047
18046
|
jsonAccount = { pubkey, username, firstName: username, lastName: username };
|