fix(paperless-ai): fix sed token extraction to handle JSON spaces
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user