fix(paperless-ai): fix sed token extraction to handle JSON spaces

This commit is contained in:
2026-09-14 23:56:33 +09:00
parent e0c08a90b3
commit 4ad0102260
+2 -2
View File
@@ -43,8 +43,8 @@ spec:
-d "client_secret=${LLM_AUTH_CLIENT_SECRET}" \ -d "client_secret=${LLM_AUTH_CLIENT_SECRET}" \
-d "scope=openid llm:inference" 2>/dev/null) -d "scope=openid llm:inference" 2>/dev/null)
# Extract token from JSON response using sed # Extract token from JSON response using sed (handles spaces after colons)
TOKEN=$(echo "$TOKEN_RESPONSE" | sed -n 's/.*"access_token":"\([^"]*\)".*/\1/p') TOKEN=$(echo "$TOKEN_RESPONSE" | sed -n 's/.*"access_token"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
if [ -z "$TOKEN" ]; then if [ -z "$TOKEN" ]; then
echo "[error] Failed to get token. Response: $TOKEN_RESPONSE" echo "[error] Failed to get token. Response: $TOKEN_RESPONSE"