2024-01-12 14:09:31 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-12 14:44:18 +01:00
|
|
|
source ./credentials
|
2024-01-12 14:09:31 +01:00
|
|
|
|
2024-01-17 12:19:33 +01:00
|
|
|
API_PORT=${API_PORT:-8080}
|
|
|
|
|
|
|
|
|
|
|
|
refresh_token=$(curl -X POST -H "Content-Type: application/json" -d "{\"username\":\"${username}\", \"password\":\"${password}\"}" 127.0.0.1:${API_PORT}/login | jq -r .refresh_token)
|
2024-01-12 14:09:31 +01:00
|
|
|
echo refresh_token: $refresh_token
|
|
|
|
|
2024-01-17 12:19:33 +01:00
|
|
|
token=$(curl -X POST -H "Content-Type: application/json" -d "{\"refresh_token\":\"${refresh_token}\"}" 127.0.0.1:${API_PORT}/perform-login | jq -r .token)
|
2024-01-12 14:09:31 +01:00
|
|
|
echo token: $token
|