Spaces:
network01
/
Runtime error

akhaliq HF Staff commited on
Commit
0fb9638
·
1 Parent(s): d84050d

Fix deployment: Use OAuth session tokens properly

Browse files

Key changes:
- Update MockAuth to accept username parameter
- get_auth_from_header now looks up OAuth sessions to extract access_token
- Session tokens are properly resolved to HF OAuth access tokens
- Added detailed logging throughout deployment process
- Better error handling with user-friendly messages for 401/403 errors
- Added HfApi.whoami() call to verify token and get username
- Improved error messages for authentication and permission issues

This ensures the deploy endpoint uses the proper OAuth token from the
authenticated session rather than trying to use a session UUID directly.

1 file changed +67 -17
backend_api.py+67-17