vern-scripts/tilserv/peertube-authcode-gen

7 lines
434 B
Plaintext
Raw Normal View History

2022-11-09 17:03:47 +00:00
#!/bin/bash
client_id="$(curl -s https://pt.vern.cc/api/v1/oauth-clients/local | jq -r '.client_id')"
client_secret="$(curl -s https://pt.vern.cc/api/v1/oauth-clients/local | jq -r '.client_secret')"
curl -s -X POST \
2022-12-11 08:32:32 +00:00
-d "client_id=${client_id}&client_secret=${client_secret}&grant_type=password&response_type=code&username=root&password=$(</root/priv/peertube-pass)" \
2022-11-09 17:03:47 +00:00
https://pt.vern.cc/api/v1/users/token | jq -r '.access_token'