Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/browser/security.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ test("session sign-in keeps reading after the original voting deadline and clear
test("an expired vote removes voting access without discarding the reading hash", async ({ page, collector }) => {
const session = await collector.send("session", 3);
await page.goto(`${collector.url}/#connect=${session.session_token}`);
await expect(page.getByText("You are connected for voting.", { exact: true })).toBeVisible();
await page.getByRole("navigation", { name: "Main navigation" })
.getByRole("link", { name: "Feature requests", exact: true }).click();
const vote = page.getByRole("button", { name: "Vote for Synthetic request", exact: true });
await expect(vote).toBeEnabled();
// The server expires first (clock skew or a suspended browser timer).
Expand Down
12 changes: 10 additions & 2 deletions web/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ function AccessForm({

function Overview({
credential,
voting,
unlock,
expire,
}: {
credential: string;
voting: boolean;
unlock: (hash: string) => void;
expire: () => void;
}) {
Expand Down Expand Up @@ -283,6 +285,11 @@ function Overview({
</li>
</ul>
</section>
{voting && (
<div className="notice">
<strong>{t.votingConnected}</strong> {t.votingDuration}
</div>
)}
{!data.installations && (
<div className="notice">
<strong>{t.firstReportsTitle}</strong> {t.firstReportsIntro}
Expand Down Expand Up @@ -1136,8 +1143,8 @@ function App() {
token: connect,
expiresAt: Date.parse(value.expires_at),
});
setRoute("/requests");
history.replaceState(null, "", "/requests");
setRoute("/");
history.replaceState(null, "", "/");
})
.catch(() => {
if (!controller.signal.aborted) setSessionError(true);
Expand Down Expand Up @@ -1192,6 +1199,7 @@ function App() {
<Overview
key={credential}
credential={credential}
voting={Boolean(token)}
unlock={unlock}
expire={signOut}
/>
Expand Down
Loading