@travetto/auth 7.1.4 → 8.0.0-alpha.0

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
@@ -74,7 +74,7 @@ export interface Authenticator<T = unknown, C = unknown, P extends Principal = P
74
74
  *
75
75
  * @returns Valid principal if authenticated
76
76
  * @returns undefined if authentication is valid, but incomplete (multi-step)
77
- * @throws AppError if authentication fails
77
+ * @throws Error if authentication fails
78
78
  */
79
79
  authenticate(payload: T, context?: C): Promise<P | undefined> | P | undefined;
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/auth",
3
- "version": "7.1.4",
3
+ "version": "8.0.0-alpha.0",
4
4
  "type": "module",
5
5
  "description": "Authentication scaffolding for the Travetto framework",
6
6
  "keywords": [
@@ -24,7 +24,7 @@
24
24
  "directory": "module/auth"
25
25
  },
26
26
  "dependencies": {
27
- "@travetto/context": "^7.1.4"
27
+ "@travetto/context": "^8.0.0-alpha.0"
28
28
  },
29
29
  "travetto": {
30
30
  "displayName": "Authentication"
package/src/config.ts CHANGED
@@ -12,6 +12,6 @@ export class AuthConfig {
12
12
  maxAgeMs: number;
13
13
 
14
14
  postConstruct(): void {
15
- this.maxAgeMs = TimeUtil.asMillis(this.maxAge);
15
+ this.maxAgeMs = TimeUtil.duration(this.maxAge, 'ms');
16
16
  }
17
17
  }
@@ -24,7 +24,7 @@ export interface Authenticator<T = unknown, C = unknown, P extends Principal = P
24
24
  *
25
25
  * @returns Valid principal if authenticated
26
26
  * @returns undefined if authentication is valid, but incomplete (multi-step)
27
- * @throws AppError if authentication fails
27
+ * @throws Error if authentication fails
28
28
  */
29
29
  authenticate(payload: T, context?: C): Promise<P | undefined> | P | undefined;
30
30
  }
@@ -1,6 +1,6 @@
1
- import { AppError, type ErrorCategory } from '@travetto/runtime';
1
+ import { RuntimeError, type ErrorCategory } from '@travetto/runtime';
2
2
 
3
- export class AuthenticationError<T = Record<string, unknown> | undefined> extends AppError<T> {
3
+ export class AuthenticationError<T = Record<string, unknown> | undefined> extends RuntimeError<T> {
4
4
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
5
5
  static defaultCategory = 'authentication' as ErrorCategory;
6
6
  }