|
@ -24,8 +24,7 @@ export class ApiKeyStrategy extends PassportStrategy( |
|
|
super({ header: HEADER_KEY_TOKEN, prefix: 'Api-Key ' }, false); |
|
|
super({ header: HEADER_KEY_TOKEN, prefix: 'Api-Key ' }, false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async validate(apiKey: string): Promise<any> { |
|
|
public async validate(apiKey: string) { |
|
|
try { |
|
|
|
|
|
const user = await this.validateApiKey(apiKey); |
|
|
const user = await this.validateApiKey(apiKey); |
|
|
|
|
|
|
|
|
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { |
|
|
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { |
|
@ -47,9 +46,6 @@ export class ApiKeyStrategy extends PassportStrategy( |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return user; |
|
|
return user; |
|
|
} catch (error) { |
|
|
|
|
|
throw error; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private async validateApiKey(apiKey: string) { |
|
|
private async validateApiKey(apiKey: string) { |
|
|