fix(paperless-ai): use jq for JWT token extraction instead of grep

This commit is contained in:
2026-09-14 23:54:57 +09:00
parent 91ce48ffae
commit ae93c7ca0d
+3 -3
View File
@@ -43,10 +43,10 @@ spec:
-d "client_secret=${LLM_AUTH_CLIENT_SECRET}" \
-d "scope=openid llm:inference" 2>/dev/null)
# Extract token
TOKEN=$(echo "$TOKEN_RESPONSE" | grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
# Extract token using jq
TOKEN=$(echo "$TOKEN_RESPONSE" | jq -r '.access_token')
if [ -z "$TOKEN" ]; then
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
echo "[error] Failed to get token. Response: $TOKEN_RESPONSE"
exit 1
fi