diff --git a/packages/auth/src/Domain/Authenticator/AuthenticatorRepositoryInterface.ts b/packages/auth/src/Domain/Authenticator/AuthenticatorRepositoryInterface.ts index f40d89570..123788e21 100644 --- a/packages/auth/src/Domain/Authenticator/AuthenticatorRepositoryInterface.ts +++ b/packages/auth/src/Domain/Authenticator/AuthenticatorRepositoryInterface.ts @@ -5,7 +5,7 @@ import { Authenticator } from './Authenticator' export interface AuthenticatorRepositoryInterface { findByUserUuid(userUuid: Uuid): Promise findById(id: UniqueEntityId): Promise - findByUserUuidAndCredentialId(userUuid: Uuid, credentialId: Buffer): Promise + findByUserUuidAndCredentialId(userUuid: Uuid, credentialId: string): Promise save(authenticator: Authenticator): Promise remove(authenticator: Authenticator): Promise removeByUserUuid(userUuid: Uuid): Promise diff --git a/packages/auth/src/Domain/UseCase/VerifyAuthenticatorAuthenticationResponse/VerifyAuthenticatorAuthenticationResponse.ts b/packages/auth/src/Domain/UseCase/VerifyAuthenticatorAuthenticationResponse/VerifyAuthenticatorAuthenticationResponse.ts index c2d0b2685..9dda9bea4 100644 --- a/packages/auth/src/Domain/UseCase/VerifyAuthenticatorAuthenticationResponse/VerifyAuthenticatorAuthenticationResponse.ts +++ b/packages/auth/src/Domain/UseCase/VerifyAuthenticatorAuthenticationResponse/VerifyAuthenticatorAuthenticationResponse.ts @@ -29,7 +29,7 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa const authenticator = await this.authenticatorRepository.findByUserUuidAndCredentialId( userUuid, - Buffer.from(dto.authenticatorResponse.id as string), + dto.authenticatorResponse.id as string, ) if (!authenticator) { return Result.fail( diff --git a/packages/auth/src/Infra/MySQL/MySQLAuthenticatorRepository.ts b/packages/auth/src/Infra/MySQL/MySQLAuthenticatorRepository.ts index e5901bee4..36881ced1 100644 --- a/packages/auth/src/Infra/MySQL/MySQLAuthenticatorRepository.ts +++ b/packages/auth/src/Infra/MySQL/MySQLAuthenticatorRepository.ts @@ -38,7 +38,7 @@ export class MySQLAuthenticatorRepository implements AuthenticatorRepositoryInte await this.ormRepository.remove(this.mapper.toProjection(authenticator)) } - async findByUserUuidAndCredentialId(userUuid: Uuid, credentialId: Buffer): Promise { + async findByUserUuidAndCredentialId(userUuid: Uuid, credentialId: string): Promise { const persistence = await this.ormRepository .createQueryBuilder('authenticator') .where('authenticator.user_uuid = :userUuid AND authenticator.credential_id = :credentialId', { diff --git a/packages/auth/src/Infra/TypeORM/TypeORMAuthenticator.ts b/packages/auth/src/Infra/TypeORM/TypeORMAuthenticator.ts index f619d5593..6b6d130a4 100644 --- a/packages/auth/src/Infra/TypeORM/TypeORMAuthenticator.ts +++ b/packages/auth/src/Infra/TypeORM/TypeORMAuthenticator.ts @@ -20,10 +20,9 @@ export class TypeORMAuthenticator { @Column({ name: 'credential_id', - type: 'varbinary', - length: 1024, + type: 'text', }) - declare credentialId: Buffer + declare credentialId: string @Column({ name: 'credential_public_key', diff --git a/packages/auth/src/Mapping/AuthenticatorPersistenceMapper.ts b/packages/auth/src/Mapping/AuthenticatorPersistenceMapper.ts index cabc822e9..7bc8a327d 100644 --- a/packages/auth/src/Mapping/AuthenticatorPersistenceMapper.ts +++ b/packages/auth/src/Mapping/AuthenticatorPersistenceMapper.ts @@ -24,7 +24,7 @@ export class AuthenticatorPersistenceMapper implements MapperInterface