The Moorcheh API was not accepting authentication headers correctly, causing 401 Unauthorized errors.
The Moorcheh API was not accepting authentication headers correctly, causing 401 Unauthorized errors.
The API expected the auth token in the format Bearer {token}, but the client was sending it as {token} only.
Added proper Bearer prefix to the auth header before sending requests.
Bearer prefix to the tokenheaders = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
## Verification
```bash
echo "Lesson: Moorcheh API Auth Header Bug"
wc -l lessons/contrib/auth-header-bug.mdExpected Output:
Lesson: Moorcheh API Auth Header Bug
# (line count)