fix(paperless-ai): use sed for JWT token extraction (jq not available)
This commit is contained in:
@@ -43,10 +43,10 @@ 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 using jq
|
# Extract token from JSON response using sed
|
||||||
TOKEN=$(echo "$TOKEN_RESPONSE" | jq -r '.access_token')
|
TOKEN=$(echo "$TOKEN_RESPONSE" | sed -n 's/.*"access_token":"\([^"]*\)".*/\1/p')
|
||||||
|
|
||||||
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
|
if [ -z "$TOKEN" ]; then
|
||||||
echo "[error] Failed to get token. Response: $TOKEN_RESPONSE"
|
echo "[error] Failed to get token. Response: $TOKEN_RESPONSE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user