diff options
Diffstat (limited to 'server/middlewares/activitypub.ts')
-rw-r--r-- | server/middlewares/activitypub.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts index c2ad18195..489396447 100644 --- a/server/middlewares/activitypub.ts +++ b/server/middlewares/activitypub.ts | |||
@@ -2,16 +2,16 @@ import { eachSeries } from 'async' | |||
2 | import { NextFunction, Request, RequestHandler, Response } from 'express' | 2 | import { NextFunction, Request, RequestHandler, Response } from 'express' |
3 | import { ActivityPubSignature } from '../../shared' | 3 | import { ActivityPubSignature } from '../../shared' |
4 | import { isSignatureVerified, logger } from '../helpers' | 4 | import { isSignatureVerified, logger } from '../helpers' |
5 | import { database as db } from '../initializers' | 5 | import { ACCEPT_HEADERS, ACTIVITY_PUB } from '../initializers' |
6 | import { ACCEPT_HEADERS, ACTIVITY_PUB } from '../initializers/constants' | 6 | import { fetchRemoteAccount, saveAccountAndServerIfNotExist } from '../lib/activitypub' |
7 | import { fetchRemoteAccount, saveAccountAndServerIfNotExist } from '../lib/activitypub/account' | 7 | import { AccountModel } from '../models/account/account' |
8 | 8 | ||
9 | async function checkSignature (req: Request, res: Response, next: NextFunction) { | 9 | async function checkSignature (req: Request, res: Response, next: NextFunction) { |
10 | const signatureObject: ActivityPubSignature = req.body.signature | 10 | const signatureObject: ActivityPubSignature = req.body.signature |
11 | 11 | ||
12 | logger.debug('Checking signature of account %s...', signatureObject.creator) | 12 | logger.debug('Checking signature of account %s...', signatureObject.creator) |
13 | 13 | ||
14 | let account = await db.Account.loadByUrl(signatureObject.creator) | 14 | let account = await AccountModel.loadByUrl(signatureObject.creator) |
15 | 15 | ||
16 | // We don't have this account in our database, fetch it on remote | 16 | // We don't have this account in our database, fetch it on remote |
17 | if (!account) { | 17 | if (!account) { |