vern-scripts/tilserv/peertube-authcode-gen

7 lines
429 B
Bash
Executable File

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