X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a2a35bb1683304edd8d20e1a2b5df29e81669b46..099468843d687fdc8c6fbb0f0e3dc54f59d0de15:/src/views/login-panel/login-panel.tsx

diff --git a/src/views/login-panel/login-panel.tsx b/src/views/login-panel/login-panel.tsx
index c857c0b2..f834b3b6 100644
--- a/src/views/login-panel/login-panel.tsx
+++ b/src/views/login-panel/login-panel.tsx
@@ -2,16 +2,17 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
+import React from 'react';
 import { connect, DispatchProp } from 'react-redux';
 import { Grid, Typography, Button, Select } from '@material-ui/core';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
-import { login, authActions } from '~/store/auth/auth-action';
-import { ArvadosTheme } from '~/common/custom-theme';
-import { RootState } from '~/store/store';
-import { LoginForm } from '~/views-components/login-form/login-form';
+import { login, authActions } from 'store/auth/auth-action';
+import { ArvadosTheme } from 'common/custom-theme';
+import { RootState } from 'store/store';
+import { LoginForm } from 'views-components/login-form/login-form';
 import Axios from 'axios';
-import { Config } from '~/common/config';
+import { Config } from 'common/config';
+import { sanitizeHTML } from 'common/html-sanitize';
 
 type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button';
 
@@ -51,7 +52,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 });
 
 const doPasswordLogin = (url: string) => (username: string, password: string) => {
-    const formData = [];
+    const formData: string[] = [];
     formData.push('username='+encodeURIComponent(username));
     formData.push('password='+encodeURIComponent(password));
     return Axios.post(`${url}/arvados/v1/users/authenticate`, formData.join('&'), {
@@ -70,7 +71,7 @@ type LoginPanelProps = DispatchProp<any> & WithStyles<CssRules> & {
     passwordLogin: boolean,
 };
 
-const loginOptions = ['LDAP', 'PAM'];
+const loginOptions = ['LDAP', 'PAM', 'Test'];
 
 export const requirePasswordLogin = (config: Config): boolean => {
     if (config && config.clusterConfig && config.clusterConfig.Login) {
@@ -98,7 +99,7 @@ export const LoginPanel = withStyles(styles)(
             style={{ marginTop: 56, overflowY: "auto", height: "100%" }}>
             <Grid item className={classes.container}>
                 <Typography component="div">
-                    <div dangerouslySetInnerHTML={{ __html: welcomePage }} style={{ margin: "1em" }} />
+                    <div dangerouslySetInnerHTML={{ __html: sanitizeHTML(welcomePage) }} style={{ margin: "1em" }} />
                 </Typography>
                 {Object.keys(remoteHosts).length > 1 && loginCluster === "" &&
 
