vern-scripts/tilserv/peertube-authcode-gen

7 lines
448 B
Bash
Executable File

#!/usr/bin/env -S bash -e
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 \
-d "client_id=${client_id}&client_secret=${client_secret}&grant_type=password&response_type=code&username=root&password=$(</root/priv/peertube-pass)" \
https://pt.vern.cc/api/v1/users/token | jq -r '.access_token'