@toa.io/extensions.exposition 1.0.0-alpha.195 → 1.0.0-alpha.197

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.
@@ -17,17 +17,19 @@ export async function effect (input: Input, context: Context): Promise<Output |
17
17
  return ERR_EXPIRED
18
18
  }
19
19
 
20
- const identity = await context.local.ensure({
20
+ const entry = await context.local.ensure({
21
21
  entity: {
22
22
  authority,
23
23
  username
24
24
  }
25
25
  })
26
26
 
27
- if (identity === null)
27
+ if (entry === null)
28
28
  return ERR_NOT_FOUND
29
29
 
30
- return { identity: { id: identity.id } }
30
+ const id = entry.identity ?? entry.id
31
+
32
+ return { identity: { id } }
31
33
  }
32
34
 
33
35
  const ERR_INVALID_CREDENTIALS = new Err('INVALID_CREDENTIALS')
@@ -9,9 +9,9 @@ export async function effect (input: Input, context: Context): Promise<Output> {
9
9
  if (identity !== undefined)
10
10
  await context.local.ensure({
11
11
  entity: {
12
- id: identity,
13
12
  authority,
14
- username
13
+ username,
14
+ identity,
15
15
  }
16
16
  })
17
17
 
@@ -2,4 +2,5 @@ export interface Entity {
2
2
  id: string
3
3
  authority: string
4
4
  username: string
5
+ identity?: string
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.exposition",
3
- "version": "1.0.0-alpha.195",
3
+ "version": "1.0.0-alpha.197",
4
4
  "description": "Toa Exposition",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -50,8 +50,6 @@
50
50
  "features:octets": "cucumber-js features/octets.*"
51
51
  },
52
52
  "devDependencies": {
53
- "@toa.io/agent": "1.0.0-alpha.195",
54
- "@toa.io/extensions.storages": "1.0.0-alpha.191",
55
53
  "@types/bcryptjs": "2.4.3",
56
54
  "@types/cors": "2.8.13",
57
55
  "@types/negotiator": "0.6.1",
@@ -63,5 +61,5 @@
63
61
  },
64
62
  "testEnvironment": "node"
65
63
  },
66
- "gitHead": "1b88e84c02e44286f8a63fb16e861f2e7bf6f878"
64
+ "gitHead": "630fc3af7de745d97f5c06a6c1b204f0cdf7d4c7"
67
65
  }