aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/get-access-token.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tools/get-access-token.ts')
-rw-r--r--server/tools/get-access-token.ts48
1 files changed, 0 insertions, 48 deletions
diff --git a/server/tools/get-access-token.ts b/server/tools/get-access-token.ts
deleted file mode 100644
index d86c84c8d..000000000
--- a/server/tools/get-access-token.ts
+++ /dev/null
@@ -1,48 +0,0 @@
1import * as program from 'commander'
2
3import {
4 getClient,
5 serverLogin,
6 Server,
7 Client,
8 User
9} from '../tests/utils/index'
10
11program
12 .option('-u, --url <url>', 'Server url')
13 .option('-n, --username <username>', 'Username')
14 .option('-p, --password <token>', 'Password')
15 .parse(process.argv)
16
17if (
18 !program['url'] ||
19 !program['username'] ||
20 !program['password']
21) {
22 throw new Error('All arguments are required.')
23}
24
25getClient(program.url)
26 .then(res => {
27 const server = {
28 url: program['url'],
29 user: {
30 username: program['username'],
31 password: program['password']
32 } as User,
33 client: {
34 id: res.body.client_id as string,
35 secret: res.body.client_secret as string
36 } as Client
37 } as Server
38
39 return serverLogin(server)
40 })
41 .then(accessToken => {
42 console.log(accessToken)
43 process.exit(0)
44 })
45 .catch(err => {
46 console.error(err)
47 process.exit(-1)
48 })