@travetto/auth-model 5.0.0-rc.7 → 5.0.0-rc.9
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/package.json +4 -4
- package/src/model.ts +2 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/auth-model",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.9",
|
|
4
4
|
"description": "Authentication model support for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"directory": "module/auth-model"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/auth": "^5.0.0-rc.
|
|
29
|
-
"@travetto/model": "^5.0.0-rc.
|
|
28
|
+
"@travetto/auth": "^5.0.0-rc.9",
|
|
29
|
+
"@travetto/model": "^5.0.0-rc.9"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/test": "^5.0.0-rc.
|
|
32
|
+
"@travetto/test": "^5.0.0-rc.9"
|
|
33
33
|
},
|
|
34
34
|
"peerDependenciesMeta": {
|
|
35
35
|
"@travetto/test": {
|
package/src/model.ts
CHANGED
|
@@ -49,7 +49,7 @@ export class ModelAuthService<T extends ModelType> implements
|
|
|
49
49
|
constructor(
|
|
50
50
|
modelService: ModelCrudSupport,
|
|
51
51
|
cls: Class<T>,
|
|
52
|
-
public toPrincipal: (t: T) => RegisteredPrincipal,
|
|
52
|
+
public toPrincipal: (t: OptionalId<T>) => RegisteredPrincipal,
|
|
53
53
|
public fromPrincipal: (t: Partial<RegisteredPrincipal>) => Partial<T>,
|
|
54
54
|
) {
|
|
55
55
|
this.#modelService = modelService;
|
|
@@ -101,8 +101,7 @@ export class ModelAuthService<T extends ModelType> implements
|
|
|
101
101
|
* @param user The user to register
|
|
102
102
|
*/
|
|
103
103
|
async register(user: OptionalId<T>): Promise<T> {
|
|
104
|
-
|
|
105
|
-
const ident = this.toPrincipal(user as T);
|
|
104
|
+
const ident = this.toPrincipal(user);
|
|
106
105
|
|
|
107
106
|
try {
|
|
108
107
|
if (ident.id) {
|