@travetto/auth 8.0.0-alpha.0 → 8.0.0-alpha.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/auth",
3
- "version": "8.0.0-alpha.0",
3
+ "version": "8.0.0-alpha.2",
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": "^8.0.0-alpha.0"
27
+ "@travetto/context": "^8.0.0-alpha.2"
28
28
  },
29
29
  "travetto": {
30
30
  "displayName": "Authentication"
package/src/config.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Config } from '@travetto/config';
2
+ import { PostConstruct } from '@travetto/di';
2
3
  import { type TimeSpan, TimeUtil } from '@travetto/runtime';
3
4
  import { Ignore } from '@travetto/schema';
4
5
 
@@ -11,7 +12,8 @@ export class AuthConfig {
11
12
  @Ignore()
12
13
  maxAgeMs: number;
13
14
 
14
- postConstruct(): void {
15
+ @PostConstruct()
16
+ finalize(): void {
15
17
  this.maxAgeMs = TimeUtil.duration(this.maxAge, 'ms');
16
18
  }
17
19
  }
package/src/service.ts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { DependencyRegistryIndex, getDefaultQualifier, Inject, Injectable } from '@travetto/di';
2
+ import { DependencyRegistryIndex, getDefaultQualifier, Inject, Injectable, PostConstruct } from '@travetto/di';
3
3
  import { toConcrete, TimeUtil } from '@travetto/runtime';
4
4
 
5
5
  import type { Principal } from './types/principal.ts';
@@ -23,7 +23,8 @@ export class AuthService {
23
23
  @Inject()
24
24
  authorizer?: Authorizer;
25
25
 
26
- async postConstruct(): Promise<void> {
26
+ @PostConstruct()
27
+ async registerAuthenticators(): Promise<void> {
27
28
  // Find all authenticators
28
29
  const AuthenticatorTarget = toConcrete<Authenticator>();
29
30
  for (const source of DependencyRegistryIndex.getCandidates(AuthenticatorTarget)) {