@@ -31,7 +31,7 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
3131 const locale = req . args [ "locale" ] || "en"
3232 i18n . changeLanguage ( locale )
3333 const appName = req . args [ "app-name" ] || "code-server"
34- const welcomeText = escapeHtml ( req . args [ "welcome-text" ] || ( i18n . t ( "WELCOME" , { app : appName } ) as string ) )
34+ const welcomeText = req . args [ "welcome-text" ] || ( i18n . t ( "WELCOME" , { app : appName } ) as string )
3535
3636 // Determine password message using i18n
3737 let passwordMsg = i18n . t ( "LOGIN_PASSWORD" , { configFile : req . args . config } )
@@ -40,23 +40,16 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
4040 } else if ( req . args . usingEnvHashedPassword ) {
4141 passwordMsg = i18n . t ( "LOGIN_USING_HASHED_PASSWORD" )
4242 }
43- passwordMsg = escapeHtml ( passwordMsg )
44-
45- // Get messages from i18n (with HTML escaping for security)
46- const loginTitle = escapeHtml ( i18n . t ( "LOGIN_TITLE" , { app : appName } ) )
47- const loginBelow = escapeHtml ( i18n . t ( "LOGIN_BELOW" ) )
48- const passwordPlaceholder = escapeHtml ( i18n . t ( "PASSWORD_PLACEHOLDER" ) )
49- const submitText = escapeHtml ( i18n . t ( "SUBMIT" ) )
5043
5144 return replaceTemplates (
5245 req ,
5346 content
54- . replace ( / { { I1 8 N _ L O G I N _ T I T L E } } / g, loginTitle )
47+ . replace ( / { { I1 8 N _ L O G I N _ T I T L E } } / g, i18n . t ( "LOGIN_TITLE" , { app : appName } ) )
5548 . replace ( / { { WELCOME_ T E X T } } / g, welcomeText )
5649 . replace ( / { { PASSWORD_ M S G } } / g, passwordMsg )
57- . replace ( / { { I1 8 N _ L O G I N _ B E L O W } } / g, loginBelow )
58- . replace ( / { { I1 8 N _ P A S S W O R D _ P L A C E H O L D E R } } / g, passwordPlaceholder )
59- . replace ( / { { I1 8 N _ S U B M I T } } / g, submitText )
50+ . replace ( / { { I1 8 N _ L O G I N _ B E L O W } } / g, i18n . t ( "LOGIN_BELOW" ) )
51+ . replace ( / { { I1 8 N _ P A S S W O R D _ P L A C E H O L D E R } } / g, i18n . t ( "PASSWORD_PLACEHOLDER" ) )
52+ . replace ( / { { I1 8 N _ S U B M I T } } / g, i18n . t ( "SUBMIT" ) )
6053 . replace ( / { { ERROR} } / , error ? `<div class="error">${ escapeHtml ( error . message ) } </div>` : "" ) ,
6154 )
6255}
0 commit comments