@travetto/auth-model 4.1.3 → 5.0.0-rc.1

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.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/package.json +4 -4
  3. package/src/model.ts +2 -3
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 ArcSine Technologies
3
+ Copyright (c) 2023 ArcSine Technologies
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/auth-model",
3
- "version": "4.1.3",
3
+ "version": "5.0.0-rc.1",
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": "^4.1.1",
29
- "@travetto/model": "^4.1.3"
28
+ "@travetto/auth": "^5.0.0-rc.1",
29
+ "@travetto/model": "^5.0.0-rc.1"
30
30
  },
31
31
  "peerDependencies": {
32
- "@travetto/test": "^4.1.1"
32
+ "@travetto/test": "^5.0.0-rc.1"
33
33
  },
34
34
  "peerDependenciesMeta": {
35
35
  "@travetto/test": {
package/src/model.ts CHANGED
@@ -34,8 +34,7 @@ export interface RegisteredPrincipal extends Principal {
34
34
  */
35
35
  export class ModelAuthService<T extends ModelType> implements
36
36
  Authenticator<T, RegisteredPrincipal>,
37
- Authorizer<RegisteredPrincipal>
38
- {
37
+ Authorizer<RegisteredPrincipal> {
39
38
 
40
39
  #modelService: ModelCrudSupport;
41
40
  #cls: Class<T>;
@@ -163,7 +162,7 @@ export class ModelAuthService<T extends ModelType> implements
163
162
  const salt = await Util.uuid();
164
163
 
165
164
  ident.resetToken = await AuthUtil.generateHash(Util.uuid(), salt, 25000, 32);
166
- ident.resetExpires = TimeUtil.timeFromNow('1h');
165
+ ident.resetExpires = TimeUtil.fromNow(1, 'h');
167
166
 
168
167
  Object.assign(user, this.fromPrincipal(ident));
169
168