]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/webfinger.ts
Misc cleanup
[github/Chocobozzz/PeerTube.git] / server / helpers / webfinger.ts
index 0155e5f3eed580c959e98bae09f0cd0cbf7d883f..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 { WebFingerData } from '../../shared'
-import { fetchRemoteAccountAndCreatePod } from './activitypub'
 
 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 fetchRemoteAccountAndCreatePod(selfLink.href)
-  if (res === undefined) throw new Error('Cannot fetch and create pod 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
 }
 
 // ---------------------------------------------------------------------------