]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/webfinger.ts
Misc cleanup
[github/Chocobozzz/PeerTube.git] / server / helpers / webfinger.ts
index b7408c845b0c140e64002912700ace77397471de..ab28889818c4244050f8011365fb3cdeee046d5b 100644 (file)
@@ -1,9 +1,8 @@
 import * as WebFinger from 'webfinger.js'
 import { WebFingerData } from '../../shared'
-
+import { fetchRemoteAccount } from '../lib/activitypub/account'
 import { isTestInstance } from './core-utils'
 import { isActivityPubUrlValid } from './custom-validators'
-import { fetchRemoteAccountAndCreateServer } from '../lib/activitypub/account'
 
 const webfinger = new WebFinger({
   webfist_fallback: false,
@@ -22,10 +21,10 @@ async function getAccountFromWebfinger (nameWithHost: string) {
     throw new Error('Cannot find self link or href is not a valid URL.')
   }
 
-  const res = await fetchRemoteAccountAndCreateServer(selfLink.href)
-  if (res === undefined) throw new Error('Cannot fetch and create server of remote account ' + selfLink.href)
+  const account = await fetchRemoteAccount(selfLink.href)
+  if (account === undefined) throw new Error('Cannot fetch remote account ' + selfLink.href)
 
-  return res.account
+  return account
 }
 
 // ---------------------------------------------------------------------------