mirror of
https://github.com/go-gitea/gitea.git
synced 2026-12-03 21:32:25 -06:00
The two 2FA login forms relied on the deprecated `RenderWithErrDeprecated` path, which re-rendered the whole page on a wrong code and made the submit button send a duplicate request on a second click. Migrate both forms to `form-fetch-action` and return JSON errors from the handlers, so the framework's built-in in-flight guard blocks duplicate submissions and errors are shown as toasts. Fixes: https://github.com/go-gitea/gitea/issues/27427 Assisted-by: OpenCode:hy4-flash-free --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
import {env} from 'node:process';
import {test, expect} from '@playwright/test';
import {apiCreateRepo, randomString} from './utils.ts';
test('repo readme', async ({page}) => {
const repoName = `e2e-readme-${randomString(8)}`;
await apiCreateRepo(page.request, {name: repoName});
await page.goto(`/${env.GITEA_TEST_E2E_USER}/${repoName}`);
await expect(page.locator('#readme')).toContainText(repoName);
});