Browse Source

Setup API key strategy

pull/4093/head
Thomas Kaul 9 months ago
parent
commit
cd58c30d2a
  1. 2
      apps/api/src/app/auth/api-key.strategy.ts
  2. 2
      apps/api/src/services/api-key/api-key.service.ts

2
apps/api/src/app/auth/api-key.strategy.ts

@ -15,7 +15,7 @@ export class ApiKeyStrategy extends PassportStrategy(
HeaderAPIKeyStrategy,
'api-key'
) {
constructor(
public constructor(
private readonly apiKeyService: ApiKeyService,
private readonly configurationService: ConfigurationService,
private readonly prismaService: PrismaService,

2
apps/api/src/services/api-key/api-key.service.ts

@ -11,7 +11,7 @@ export class ApiKeyService {
private readonly iterations = 100000;
private readonly keyLength = 64;
constructor(private readonly prismaService: PrismaService) {}
public constructor(private readonly prismaService: PrismaService) {}
public async create({ userId }: { userId: string }): Promise<ApiKeyResponse> {
const apiKey = this.generateApiKey();

Loading…
Cancel
Save