fix issues in core
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import { randomUUID } from 'crypto';
|
||||
import { createStaticRacingSeed } from '@core/testing-support';
|
||||
import type { IdentityProviderPort } from '../../application/ports/IdentityProviderPort';
|
||||
import type { StartAuthCommandDTO } from '../../application/dto/StartAuthCommandDTO';
|
||||
import type { AuthCallbackCommandDTO } from '../../application/dto/AuthCallbackCommandDTO';
|
||||
import type { AuthenticatedUserDTO } from '../../application/dto/AuthenticatedUserDTO';
|
||||
import type {
|
||||
AuthCallbackCommand,
|
||||
AuthenticatedUser,
|
||||
IdentityProviderPort,
|
||||
StartAuthCommand,
|
||||
} from '@core/identity/application/ports/IdentityProviderPort';
|
||||
|
||||
export class IracingDemoIdentityProviderAdapter implements IdentityProviderPort {
|
||||
private readonly seedDriverId: string;
|
||||
|
||||
constructor() {
|
||||
const seed = createStaticRacingSeed(42);
|
||||
this.seedDriverId = seed.drivers[0]?.id ?? 'driver-1';
|
||||
this.seedDriverId = 'driver-1';
|
||||
}
|
||||
|
||||
async startAuth(command: StartAuthCommandDTO): Promise<{ redirectUrl: string; state: string }> {
|
||||
async startAuth(command: StartAuthCommand): Promise<{ redirectUrl: string; state: string }> {
|
||||
const state = randomUUID();
|
||||
|
||||
const params = new URLSearchParams();
|
||||
@@ -29,7 +29,7 @@ export class IracingDemoIdentityProviderAdapter implements IdentityProviderPort
|
||||
};
|
||||
}
|
||||
|
||||
async completeAuth(command: AuthCallbackCommandDTO): Promise<AuthenticatedUserDTO> {
|
||||
async completeAuth(command: AuthCallbackCommand): Promise<AuthenticatedUser> {
|
||||
if (!command.code) {
|
||||
throw new Error('Missing auth code');
|
||||
}
|
||||
@@ -37,7 +37,7 @@ export class IracingDemoIdentityProviderAdapter implements IdentityProviderPort
|
||||
throw new Error('Missing auth state');
|
||||
}
|
||||
|
||||
const user: AuthenticatedUserDTO = {
|
||||
const user: AuthenticatedUser = {
|
||||
id: 'demo-user',
|
||||
displayName: 'GridPilot Demo Driver',
|
||||
iracingCustomerId: '000000',
|
||||
|
||||
Reference in New Issue
Block a user