]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tools/peertube-get-access-token.ts
Fix live tests
[github/Chocobozzz/PeerTube.git] / server / tools / peertube-get-access-token.ts
index 5868d05485b0a27abbd6ae82e4991bf74f8bee4d..d59a3632e4e4bec56fccebbaf05d501db500b308 100644 (file)
@@ -1,8 +1,5 @@
-import { registerTSPaths } from '../helpers/register-ts-paths'
-registerTSPaths()
-
 import { program } from 'commander'
-import { getAccessToken } from '../../shared/extra-utils'
+import { assignToken, buildServer } from './cli'
 
 program
   .option('-u, --url <url>', 'Server url')
@@ -24,9 +21,11 @@ if (
   process.exit(-1)
 }
 
-getAccessToken(options.url, options.username, options.password)
-  .then(accessToken => {
-    console.log(accessToken)
+const server = buildServer(options.url)
+
+assignToken(server, options.username, options.password)
+  .then(() => {
+    console.log(server.accessToken)
     process.exit(0)
   })
   .catch(err => {