diff --git a/libraries/nestjs-libraries/src/integrations/social/bluesky.provider.ts b/libraries/nestjs-libraries/src/integrations/social/bluesky.provider.ts index 61a5fe6b..e81a79c8 100644 --- a/libraries/nestjs-libraries/src/integrations/social/bluesky.provider.ts +++ b/libraries/nestjs-libraries/src/integrations/social/bluesky.provider.ts @@ -6,8 +6,7 @@ import { } from '@gitroom/nestjs-libraries/integrations/social/social.integrations.interface'; import { makeId } from '@gitroom/nestjs-libraries/services/make.is'; import { - NotEnoughScopes, - SocialAbstract, + NotEnoughScopes, RefreshToken, SocialAbstract } from '@gitroom/nestjs-libraries/integrations/social.abstract'; import { BskyAgent, RichText } from '@atproto/api'; import dayjs from 'dayjs'; @@ -152,10 +151,14 @@ export class BlueskyProvider extends SocialAbstract implements SocialProvider { service: body.service, }); - await agent.login({ - identifier: body.identifier, - password: body.password, - }); + try { + await agent.login({ + identifier: body.identifier, + password: body.password, + }); + } catch (err) { + throw new RefreshToken('bluesky', JSON.stringify(err), {} as BodyInit); + } let loadCid = ''; let loadUri = '';