Harden auth/vault path sanitization and clean WeKnora docs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
|
||||
const { loginViaAuthForm } = require('./lib/browser-auth-login');
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs");
|
||||
const http = require("node:http");
|
||||
@@ -90,11 +91,12 @@ function documentUrl(baseUrl, rootUri, relativePath) {
|
||||
|
||||
async function quickLogin(page, baseUrl) {
|
||||
await page.goto(`${baseUrl}/auth`, { waitUntil: "domcontentloaded", timeout: TIMEOUT_MS });
|
||||
const quickLoginButton = page.getByRole("button", { name: "测试账号快速登录" });
|
||||
if (await quickLoginButton.count()) {
|
||||
await quickLoginButton.click({ timeout: TIMEOUT_MS });
|
||||
await page.waitForURL((url) => url.pathname === "/", { timeout: TIMEOUT_MS });
|
||||
}
|
||||
await loginViaAuthForm(page, {
|
||||
baseUrl,
|
||||
timeoutMs: TIMEOUT_MS,
|
||||
gotoAuth: false,
|
||||
});
|
||||
await page.waitForURL((url) => url.pathname === "/", { timeout: TIMEOUT_MS }).catch(() => {});
|
||||
}
|
||||
|
||||
async function main() {
|
||||
|
||||
Reference in New Issue
Block a user