Skip to content

Commit 36bbda5

Browse files
feat: add global flag to jwt options
1 parent 1ec9840 commit 36bbda5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/interfaces/jwt-module-options.interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export enum JwtSecretRequestType {
77
}
88

99
export interface JwtModuleOptions {
10+
global?: boolean;
1011
signOptions?: jwt.SignOptions;
1112
secret?: string | Buffer;
1213
publicKey?: string | Buffer;
@@ -28,6 +29,7 @@ export interface JwtOptionsFactory {
2829
}
2930

3031
export interface JwtModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
32+
global?: boolean;
3133
useExisting?: Type<JwtOptionsFactory>;
3234
useClass?: Type<JwtOptionsFactory>;
3335
useFactory?: (...args: any[]) => Promise<JwtModuleOptions> | JwtModuleOptions;

lib/jwt.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ export class JwtModule {
1616
static register(options: JwtModuleOptions): DynamicModule {
1717
return {
1818
module: JwtModule,
19+
global: options.global,
1920
providers: createJwtProvider(options)
2021
};
2122
}
2223

2324
static registerAsync(options: JwtModuleAsyncOptions): DynamicModule {
2425
return {
2526
module: JwtModule,
27+
global: options.global,
2628
imports: options.imports || [],
2729
providers: this.createAsyncProviders(options)
2830
};

0 commit comments

Comments
 (0)