Fix api keys (#2116)
* Distinguish local env variables * Remove api token secret
This commit is contained in:
@ -29,7 +29,7 @@ export class ApiKeyService {
|
||||
name: string,
|
||||
expiresAt?: Date | string,
|
||||
): Promise<AuthToken> {
|
||||
const secret = this.environmentService.getApiTokenSecret();
|
||||
const secret = this.environmentService.getAccessTokenSecret();
|
||||
let expiresIn: string | number;
|
||||
let expirationDate: Date;
|
||||
const now = new Date().getTime();
|
||||
|
||||
@ -69,10 +69,6 @@ export class EnvironmentService {
|
||||
return this.configService.get<string>('LOGIN_TOKEN_SECRET')!;
|
||||
}
|
||||
|
||||
getApiTokenSecret(): string {
|
||||
return this.configService.get<string>('API_TOKEN_SECRET')!;
|
||||
}
|
||||
|
||||
getLoginTokenExpiresIn(): string {
|
||||
return this.configService.get<string>('LOGIN_TOKEN_EXPIRES_IN') ?? '15m';
|
||||
}
|
||||
|
||||
@ -82,8 +82,6 @@ export class EnvironmentVariables {
|
||||
|
||||
@IsString()
|
||||
LOGIN_TOKEN_SECRET: string;
|
||||
@IsString()
|
||||
API_TOKEN_SECRET: string;
|
||||
@IsDuration()
|
||||
@IsOptional()
|
||||
LOGIN_TOKEN_EXPIRES_IN: string;
|
||||
|
||||
Reference in New Issue
Block a user