@owlmeans/web-auth 0.1.18-rc.60 → 0.1.18-rc.62

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/README.md CHANGED
@@ -6,7 +6,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
6
6
  your project's skill store (`.agents/skills/`):
7
7
 
8
8
  ```sh
9
- npx @owlmeans/agent-skills@^0.1.18-rc.47
9
+ npx @owlmeans/agent-skills@^0.1.18-rc.49
10
10
  ```
11
11
 
12
12
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/web-auth",
4
- "version": "0.1.18-rc.60",
5
- "generatedAt": "2026-10-03T20:05:07.592Z",
4
+ "version": "0.1.18-rc.62",
5
+ "generatedAt": "2026-10-05T21:03:06.390Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/web-auth
9
9
 
10
10
  **Layer:** Web
11
- **Install:** `"@owlmeans/web-auth": "^0.1.18-rc.60"` in `dependencies`
11
+ **Install:** `"@owlmeans/web-auth": "^0.1.18-rc.62"` in `dependencies`
12
12
 
13
13
  Web-side auth UI plugins registering into the shared `@owlmeans/client-auth/manager` plugin registry
14
14
  (mirroring `@owlmeans/web-oidc-rp`). It ships the **PK supervisor** login form.
package/build/append.d.ts CHANGED
@@ -1,22 +1,5 @@
1
- import type { CommonConfig } from '@owlmeans/config';
2
- export interface WebSupervisorAuthOptions {
3
- /** Force enable/disable. Default: `cfg.debug.supervisor === true`. */
4
- enabled?: boolean;
5
- /**
6
- * Also offer it on the sign-in screen. Defaults to true — an operator login that is registered
7
- * but reachable only by typing its URL is a login nobody finds and an exposure nobody sees.
8
- */
9
- offer?: boolean;
10
- }
11
- interface DebugCarrier {
12
- cfg: {
13
- debug?: {
14
- all?: boolean;
15
- supervisor?: boolean;
16
- };
17
- security?: CommonConfig['security'];
18
- };
19
- }
1
+ import type { DebugCarrier } from './types.local.js';
2
+ import type { WebSupervisorAuthOptions } from './types.js';
20
3
  /**
21
4
  * Unified, explicit append for the PK-based supervisor login UI. Call it once on the web client
22
5
  * context. It registers the supervisor client plugin so the form is rendered by the standard typed
@@ -24,5 +7,4 @@ interface DebugCarrier {
24
7
  * configuration — which is what turns a `restricted` method from registered into offerable.
25
8
  */
26
9
  export declare const appendSupervisorAuth: <T extends DebugCarrier>(context: T, opts?: WebSupervisorAuthOptions) => T;
27
- export {};
28
10
  //# sourceMappingURL=append.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../src/append.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAGpD,MAAM,WAAW,wBAAwB;IACvC,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,UAAU,YAAY;IACpB,GAAG,EAAE;QACH,KAAK,CAAC,EAAE;YAAE,GAAG,CAAC,EAAE,OAAO,CAAC;YAAC,UAAU,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;QAC/C,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;KACpC,CAAA;CACF;AAcD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,YAAY,WAChD,CAAC,SAAS,wBAAwB,KAC1C,CAoBF,CAAA"}
1
+ {"version":3,"file":"append.d.ts","sourceRoot":"","sources":["../src/append.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAc1D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,Y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C,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IACtE,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/supervisor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAUjF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,EAAE,oBA8EpC,CAAA"}
1
+ {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../../src/auth/plugins/supervisor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAUjF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,EAAE,oBA+EpC,CAAA"}
@@ -3,7 +3,7 @@ import { useState } from 'react';
3
3
  import { AuthenticationType, buildSupervisorPayload } from '@owlmeans/auth';
4
4
  import { DEFAULT_ALIAS as AUTH_SERVICE } from '@owlmeans/client-auth';
5
5
  import { useContext } from '@owlmeans/client';
6
- import { landAfterLogin, landingUrl } from '@owlmeans/client-auth/login';
6
+ import { loginLandingOf } from '@owlmeans/client-auth/login';
7
7
  import { makeKeyPairModel } from '@owlmeans/basic-keys';
8
8
  import { createIdOfLength } from '@owlmeans/basic-ids';
9
9
  /**
@@ -46,8 +46,9 @@ export const supervisorClientPlugin = {
46
46
  // A registered step (marketing consent, say) or a device/authorization-code consent
47
47
  // screen that suspended itself here before sending the browser to sign in both take
48
48
  // priority over the app's own home — `landAfterLogin` is the whole decision.
49
- const landing = await landAfterLogin(context);
50
- window.location.href = await landingUrl(context, landing);
49
+ const landings = loginLandingOf(context);
50
+ const landing = await landings.landAfterLogin();
51
+ window.location.href = await landings.landingUrl(landing);
51
52
  }
52
53
  catch (e) {
53
54
  setError(e instanceof Error ? e.message : String(e));
@@ -1 +1 @@
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,KAAK,EAAE,YAC/F,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,uBAAuB,GACxC,EACR,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,YAAG,IAAI,EAAC,OAAO,iBAAa,kBAAkB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,YAAG,KAAK,GAAK,CAAC,CAAC,CAAC,IAAI,IAC1G,CACR,CAAA;IACH,CAAC;IAED,+EAA+E;IAC/E,8EAA8E;IAC9E,0EAA0E;IAC1E,YAAY,EAAE,KAAK,EAAE,WAAW,EAAsB,EAAE;QACtD,MAAM,GAAG,GAAG,gBAAgB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QACpD,MAAM,IAAI,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAA;QACjC,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;QAC/G,WAAW,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;QAE5D,8EAA8E;QAC9E,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;IACtB,CAAC;CACF,CAAA"}
package/build/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './consts.js';
2
2
  export * from './append.js';
3
+ export type * from './types.js';
3
4
  export { supervisorClientPlugin } from './auth/plugins/supervisor.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA"}
@@ -0,0 +1,10 @@
1
+ export interface WebSupervisorAuthOptions {
2
+ /** Force enable/disable. Default: `cfg.debug.supervisor === true`. */
3
+ enabled?: boolean;
4
+ /**
5
+ * Also offer it on the sign-in screen. Defaults to true — an operator login that is registered
6
+ * but reachable only by typing its URL is a login nobody finds and an exposure nobody sees.
7
+ */
8
+ offer?: boolean;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB"}
package/build/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { CommonConfig } from '@owlmeans/config';
2
+ export interface DebugCarrier {
3
+ cfg: {
4
+ debug?: {
5
+ all?: boolean;
6
+ supervisor?: boolean;
7
+ };
8
+ security?: CommonConfig['security'];
9
+ };
10
+ }
11
+ //# sourceMappingURL=types.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.local.d.ts","sourceRoot":"","sources":["../src/types.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE;QACH,KAAK,CAAC,EAAE;YAAE,GAAG,CAAC,EAAE,OAAO,CAAC;YAAC,UAAU,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;QAC/C,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;KACpC,CAAA;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.local.js","sourceRoot":"","sources":["../src/types.local.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/web-auth",
3
- "version": "0.1.18-rc.60",
3
+ "version": "0.1.18-rc.62",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -29,24 +29,24 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@owlmeans/auth": "^0.1.18-rc.38",
33
- "@owlmeans/auth-common": "^0.1.18-rc.45",
34
- "@owlmeans/basic-ids": "^0.1.18-rc.35",
35
- "@owlmeans/basic-keys": "^0.1.18-rc.46",
36
- "@owlmeans/client": "^0.1.18-rc.49",
37
- "@owlmeans/client-auth": "^0.1.18-rc.56",
38
- "@owlmeans/client-flow": "^0.1.18-rc.52",
39
- "@owlmeans/config": "^0.1.18-rc.42",
40
- "@owlmeans/context": "^0.1.18-rc.32",
41
- "@owlmeans/web-client": "^0.1.18-rc.59"
32
+ "@owlmeans/auth": "^0.1.18-rc.40",
33
+ "@owlmeans/auth-common": "^0.1.18-rc.47",
34
+ "@owlmeans/basic-ids": "^0.1.18-rc.37",
35
+ "@owlmeans/basic-keys": "^0.1.18-rc.48",
36
+ "@owlmeans/client": "^0.1.18-rc.51",
37
+ "@owlmeans/client-auth": "^0.1.18-rc.58",
38
+ "@owlmeans/client-flow": "^0.1.18-rc.54",
39
+ "@owlmeans/config": "^0.1.18-rc.44",
40
+ "@owlmeans/context": "^0.1.18-rc.34",
41
+ "@owlmeans/web-client": "^0.1.18-rc.61"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "*"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@owlmeans/dep-config": "workspace:*",
48
- "@types/bun": "^1.4.0",
49
- "@types/react": "^19.2.17",
48
+ "@types/bun": "^1.4.2",
49
+ "@types/react": "^19.3.0",
50
50
  "nodemon": "^3.1.14",
51
51
  "typescript": "^7.0.2"
52
52
  },
package/src/append.ts CHANGED
@@ -2,23 +2,8 @@ import { AuthenticationType } from '@owlmeans/auth'
2
2
  import { plugins as authPlugins } from '@owlmeans/client-auth/manager'
3
3
  import type { CommonConfig } from '@owlmeans/config'
4
4
  import { supervisorClientPlugin } from './auth/plugins/supervisor.js'
5
-
6
- export interface WebSupervisorAuthOptions {
7
- /** Force enable/disable. Default: `cfg.debug.supervisor === true`. */
8
- enabled?: boolean
9
- /**
10
- * Also offer it on the sign-in screen. Defaults to true — an operator login that is registered
11
- * but reachable only by typing its URL is a login nobody finds and an exposure nobody sees.
12
- */
13
- offer?: boolean
14
- }
15
-
16
- interface DebugCarrier {
17
- cfg: {
18
- debug?: { all?: boolean, supervisor?: boolean }
19
- security?: CommonConfig['security']
20
- }
21
- }
5
+ import type { DebugCarrier } from './types.local.js'
6
+ import type { WebSupervisorAuthOptions } from './types.js'
22
7
 
23
8
  /**
24
9
  * Whether this deployment wants the PK supervisor login.
@@ -6,7 +6,7 @@ import type { AuthToken } from '@owlmeans/auth'
6
6
  import { DEFAULT_ALIAS as AUTH_SERVICE } from '@owlmeans/client-auth'
7
7
  import type { AuthService } from '@owlmeans/auth-common'
8
8
  import { useContext } from '@owlmeans/client'
9
- import { landAfterLogin, landingUrl } from '@owlmeans/client-auth/login'
9
+ import { loginLandingOf } from '@owlmeans/client-auth/login'
10
10
  import { makeKeyPairModel } from '@owlmeans/basic-keys'
11
11
  import { createIdOfLength } from '@owlmeans/basic-ids'
12
12
 
@@ -56,8 +56,9 @@ export const supervisorClientPlugin: AuthenticationPlugin = {
56
56
  // A registered step (marketing consent, say) or a device/authorization-code consent
57
57
  // screen that suspended itself here before sending the browser to sign in both take
58
58
  // priority over the app's own home — `landAfterLogin` is the whole decision.
59
- const landing = await landAfterLogin(context)
60
- window.location.href = await landingUrl(context, landing)
59
+ const landings = loginLandingOf(context)
60
+ const landing = await landings.landAfterLogin()
61
+ window.location.href = await landings.landingUrl(landing)
61
62
  } catch (e) {
62
63
  setError(e instanceof Error ? e.message : String(e))
63
64
  setBusy(false)
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './consts.js'
2
2
  export * from './append.js'
3
+ export type * from './types.js'
3
4
  export { supervisorClientPlugin } from './auth/plugins/supervisor.js'
@@ -0,0 +1,8 @@
1
+ import type { CommonConfig } from '@owlmeans/config'
2
+
3
+ export interface DebugCarrier {
4
+ cfg: {
5
+ debug?: { all?: boolean, supervisor?: boolean }
6
+ security?: CommonConfig['security']
7
+ }
8
+ }
package/src/types.ts ADDED
@@ -0,0 +1,9 @@
1
+ export interface WebSupervisorAuthOptions {
2
+ /** Force enable/disable. Default: `cfg.debug.supervisor === true`. */
3
+ enabled?: boolean
4
+ /**
5
+ * Also offer it on the sign-in screen. Defaults to true — an operator login that is registered
6
+ * but reachable only by typing its URL is a login nobody finds and an exposure nobody sees.
7
+ */
8
+ offer?: boolean
9
+ }
@@ -0,0 +1,89 @@
1
+ import { afterEach, describe, expect, test } from 'bun:test'
2
+ import { AuthenticationType, buildSupervisorPayload } from '@owlmeans/auth'
3
+ import type { AuthCredentials } from '@owlmeans/auth'
4
+ import { makeKeyPairModel, keyHelper } from '@owlmeans/basic-keys'
5
+ import { plugins as authPlugins } from '@owlmeans/client-auth/manager'
6
+ import type { CommonConfig } from '@owlmeans/config'
7
+ import { appendSupervisorAuth, SUPERVISOR_LOGIN_PATH, supervisorClientPlugin } from '../src/index.js'
8
+
9
+ type Cfg = { debug?: { all?: boolean, supervisor?: boolean }, security?: CommonConfig['security'] }
10
+ const carrier = (cfg: Cfg = {}) => ({ cfg })
11
+
12
+ afterEach(() => { delete authPlugins[AuthenticationType.Supervisor] })
13
+
14
+ describe('appendSupervisorAuth — who gets an operator login', () => {
15
+ test('nothing is registered unless the deployment asks for the supervisor on purpose', () => {
16
+ const context = carrier({ debug: { all: true } })
17
+ appendSupervisorAuth(context)
18
+
19
+ expect(authPlugins[AuthenticationType.Supervisor]).toBeUndefined()
20
+ expect(context.cfg.security).toBeUndefined()
21
+ })
22
+
23
+ test('`debug.supervisor` registers the plugin and offers it on the sign-in screen', () => {
24
+ const context = carrier({ debug: { supervisor: true } })
25
+ appendSupervisorAuth(context)
26
+
27
+ expect(authPlugins[AuthenticationType.Supervisor]).toBe(supervisorClientPlugin)
28
+ expect(context.cfg.security?.auth?.login?.secretKey).toBe(true)
29
+ expect(context.cfg.security?.auth?.login?.overrides?.[AuthenticationType.Supervisor]).toEqual({ enabled: true })
30
+ })
31
+
32
+ test('`offer: false` registers the route without putting it on the screen', () => {
33
+ const context = carrier()
34
+ appendSupervisorAuth(context, { enabled: true, offer: false })
35
+
36
+ expect(authPlugins[AuthenticationType.Supervisor]).toBe(supervisorClientPlugin)
37
+ expect(context.cfg.security).toBeUndefined()
38
+ })
39
+
40
+ test('an override the configuration already states is kept', () => {
41
+ const context = carrier({
42
+ debug: { supervisor: true },
43
+ security: { auth: { login: { secretKey: false, overrides: { [AuthenticationType.Supervisor]: { enabled: false } } } } },
44
+ } as Cfg)
45
+ appendSupervisorAuth(context)
46
+
47
+ expect(context.cfg.security?.auth?.login?.secretKey).toBe(false)
48
+ expect(context.cfg.security?.auth?.login?.overrides?.[AuthenticationType.Supervisor]).toEqual({ enabled: false })
49
+ })
50
+
51
+ test('the form lives on the standard typed authentication route', () => {
52
+ expect(SUPERVISOR_LOGIN_PATH).toBe(`/authentication/login/${AuthenticationType.Supervisor}`)
53
+ })
54
+ })
55
+
56
+ describe('supervisorClientPlugin — what it sends', () => {
57
+ test('is a restricted method, shown last as a link', () => {
58
+ expect(supervisorClientPlugin.type).toBe(AuthenticationType.Supervisor)
59
+ expect(supervisorClientPlugin.method).toMatchObject({ restricted: true, emphasis: 'link', order: 900 })
60
+ })
61
+
62
+ test('signs the challenge, the user and a fresh salt with the entered key and sends no key', async () => {
63
+ const key = makeKeyPairModel()
64
+ const credentials = { userId: 'person@example.com', credential: key.export(), challenge: 'one-time' } as AuthCredentials
65
+
66
+ const token = await supervisorClientPlugin.authenticate!(credentials)
67
+
68
+ expect(token).toEqual({ token: '' })
69
+ const packed = JSON.parse(credentials.credential) as { salt: string, signature: string }
70
+ expect(Object.keys(packed).sort()).toEqual(['salt', 'signature'])
71
+ expect(packed.salt).toHaveLength(16)
72
+ expect(credentials.credential).not.toContain(key.export())
73
+ // Verified the way the server's supervisor plugin verifies it.
74
+ const verifier = keyHelper.fromPubKey(key.exportPublic())
75
+ expect(await verifier.verify(buildSupervisorPayload('one-time', 'person@example.com', packed.salt), packed.signature)).toBe(true)
76
+ expect(await verifier.verify(buildSupervisorPayload('replayed', 'person@example.com', packed.salt), packed.signature)).toBe(false)
77
+ })
78
+
79
+ test('two sign-ins never share a salt', async () => {
80
+ const key = makeKeyPairModel().export()
81
+ const salts = await Promise.all([1, 2].map(async () => {
82
+ const credentials = { userId: 'u', credential: key, challenge: 'c' } as AuthCredentials
83
+ await supervisorClientPlugin.authenticate!(credentials)
84
+ return (JSON.parse(credentials.credential) as { salt: string }).salt
85
+ }))
86
+
87
+ expect(salts[0]).not.toBe(salts[1])
88
+ })
89
+ })