Standardize JWT authentication and finalize Activity Log V3 migration
This commit is contained in:
@@ -665,7 +665,7 @@ export const delete_ae_obj_id_crud = async function delete_ae_obj_id_crud({
|
||||
|
||||
/* BEGIN: Hosted File Related */
|
||||
|
||||
// Updated 2023-08-17
|
||||
// Updated 2026-01-07
|
||||
export const download_hosted_file = async function download_hosted_file({
|
||||
api_cfg,
|
||||
hosted_file_id,
|
||||
@@ -693,6 +693,17 @@ export const download_hosted_file = async function download_hosted_file({
|
||||
}
|
||||
params['return_file'] = true;
|
||||
|
||||
// Inject JWT into URL parameters if available
|
||||
if (api_cfg.jwt) {
|
||||
params['jwt'] = api_cfg.jwt;
|
||||
} else if (api_cfg.headers?.['authorization']) {
|
||||
// Fallback: extract from header if present
|
||||
const auth_header = api_cfg.headers['authorization'];
|
||||
if (auth_header.startsWith('Bearer ')) {
|
||||
params['jwt'] = auth_header.substring(7);
|
||||
}
|
||||
}
|
||||
|
||||
const hosted_file_download_get_promise = await api.get_object({
|
||||
api_cfg: api_cfg,
|
||||
endpoint: endpoint,
|
||||
|
||||
Reference in New Issue
Block a user