@@ -31,7 +31,7 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
31
31
const locale = req . args [ "locale" ] || "en"
32
32
i18n . changeLanguage ( locale )
33
33
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 )
35
35
36
36
// Determine password message using i18n
37
37
let passwordMsg = i18n . t ( "LOGIN_PASSWORD" , { configFile : req . args . config } )
@@ -40,23 +40,16 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
40
40
} else if ( req . args . usingEnvHashedPassword ) {
41
41
passwordMsg = i18n . t ( "LOGIN_USING_HASHED_PASSWORD" )
42
42
}
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" ) )
50
43
51
44
return replaceTemplates (
52
45
req ,
53
46
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 } ) )
55
48
. replace ( / { { WELCOME_ T E X T } } / g, welcomeText )
56
49
. 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" ) )
60
53
. replace ( / { { ERROR} } / , error ? `<div class="error">${ escapeHtml ( error . message ) } </div>` : "" ) ,
61
54
)
62
55
}
0 commit comments