revised thing

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-08-09 17:33:38 +08:00
parent 30ec1330c6
commit 9018d6d158
11 changed files with 82 additions and 82 deletions
+3 -3
View File
@@ -30,14 +30,14 @@ exports.issueToken = async (req, res) => {
attributes: ["asset_id", "file_type", "storage_provider", "storage_key", "mime_type", "thumbnail_storage_key"],
});
if (!asset) return R.error(res, "Asset not found.", 404);
if (!asset) return R.error(res, "File not found.", 404);
if (!mediaToken.SUPPORTED_TYPES.includes(asset.file_type)) {
return R.error(res, `Asset type "${asset.file_type}" is not supported.`, 400);
return R.error(res, `File type "${asset.file_type}" is not supported.`, 400);
}
if (asset.storage_provider !== "s3") {
return R.error(res, "Token flow is for S3 assets only. Use the raw file_url for other providers.", 400);
return R.error(res, "Token flow is for S3 files only. Use the raw file_url for other providers.", 400);
}
const ip = mediaToken.resolveIp(req);