Skip to content

Commit b4fd396

Browse files
committed
Use custom uhd auth header for jwt
Use `X-UHD-AUTH` header for the JWT instead of `Authorization` header - The Authorzation header is already being used for the API key which is checked by the AWS load balancer, so commands with just the JWT are rejected. - Sending both headers means the ALB can verify the API key and send the request on to Django which can then verify the JWT
1 parent f4b769f commit b4fd396

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/utils/api.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export async function client<T>(
100100
...customConfig.headers,
101101
//passing authorization header only if access token is available, to avoid sending
102102
// "Authorization: Bearer undefined" in the headers which might cause issues with some APIs
103-
...(accessToken ? { Authorization: `Bearer ${accessToken}` } : {}),
103+
...(accessToken ? { 'X-UHD-AUTH': `Bearer ${accessToken}` } : {}),
104104
},
105105
}
106106

0 commit comments

Comments
 (0)