mirror of
https://github.com/coder/code-server.git
synced 2025-07-30 05:22:04 +08:00
Fix login page
This commit is contained in:
@ -241,7 +241,7 @@ export abstract class Server {
|
||||
case "/login":
|
||||
if (!this.options.auth) {
|
||||
throw new HttpError("Not found", HttpCode.NotFound);
|
||||
} else if (requestPath === "") {
|
||||
} else if (requestPath === "/index.html") {
|
||||
return this.tryLogin(request);
|
||||
}
|
||||
this.ensureGet(request);
|
||||
@ -318,7 +318,7 @@ export abstract class Server {
|
||||
}
|
||||
|
||||
private async getLogin(error: string = "", payload?: LoginPayload): Promise<Response> {
|
||||
const filePath = path.join(this.rootPath, "out/vs/server/src/login/login.html");
|
||||
const filePath = path.join(this.rootPath, "out/vs/server/src/login/index.html");
|
||||
const content = (await util.promisify(fs.readFile)(filePath, "utf8"))
|
||||
.replace("{{ERROR}}", error)
|
||||
.replace("display:none", error ? "display:block" : "display:none")
|
||||
|
Reference in New Issue
Block a user