16812: Added new mechanism to skip token in the url
[arvados-workbench2.git] / src / views-components / context-menu / actions / file-viewer-action.tsx
index 20dcece400a2955aeaeeb42ebe55280464aa8bac..a2c32bea875e32524be04532dd90957e6da06675 100644 (file)
@@ -5,6 +5,7 @@
 import * as React from "react";
 import { ListItemIcon, ListItemText, ListItem } from "@material-ui/core";
 import { OpenIcon } from "~/components/icon/icon";
+import { sanitizeToken } from "./helpers";
 
 export const FileViewerAction = (props: { href?: any, download?: any, onClick?: () => void, kind?: string, currentCollectionUuid?: string; }) => {
     const fileProps = props.download ? { download: props.download } : {};
@@ -12,7 +13,7 @@ export const FileViewerAction = (props: { href?: any, download?: any, onClick?:
     return props.href
         ? <a
             style={{ textDecoration: 'none' }}
-            href={props.href}
+            href={sanitizeToken(props.href)}
             target="_blank"
             onClick={props.onClick}
             {...fileProps}>