This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

semble / src / modules / atproto / infrastructure / services / AtpAppPasswordProcessor.ts
823 B 24 lines
1import { ok, Result } from 'src/shared/core/Result'; 2import { IAppPasswordProcessor } from '../../application/IAppPasswordProcessor'; 3import { AuthResult } from 'src/modules/user/application/services/IOAuthProcessor'; 4import { IAppPasswordSessionService } from '../../application/IAppPasswordSessionService'; 5 6export class AtpAppPasswordProcessor implements IAppPasswordProcessor { 7 constructor(private readonly sessionService: IAppPasswordSessionService) {} 8 async processAppPassword( 9 identifier: string, 10 appPassword: string, 11 ): Promise<Result<AuthResult>> { 12 const result = await this.sessionService.createSession( 13 identifier, 14 appPassword, 15 ); 16 if (result.isErr()) { 17 return result; 18 } 19 return ok({ 20 did: result.value.did, 21 handle: result.value.handle, 22 }); 23 } 24}