-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove resume on browser refresh to avoid exposing sessionId
- Temporarily removing the feature which allows users to resume on browser refresh - The implementation exposed the sessionId which has security implications - Removed the code for the feature and accompanying test
- Loading branch information
1 parent
8f42ff4
commit 067fe7d
Showing
2 changed files
with
1 addition
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import Button from "@mui/material/Button"; | ||
import { act, screen, waitFor } from "@testing-library/react"; | ||
import { act, screen } from "@testing-library/react"; | ||
import { FullStore, vanillaStore } from "pages/FlowEditor/lib/store"; | ||
import React from "react"; | ||
import { axe, setup } from "testUtils"; | ||
|
@@ -66,31 +66,6 @@ describe("Save and Return component", () => { | |
const results = await axe(container); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
|
||
it("stores the sessionId as part of the URL once an email has been submitted", async () => { | ||
const children = <Button>Testing 123</Button>; | ||
const { user } = setup(<SaveAndReturn children={children}></SaveAndReturn>); | ||
|
||
const sessionId = getState().sessionId; | ||
expect(sessionId).toBeDefined(); | ||
|
||
await user.type(screen.getByLabelText("Email address"), "[email protected]"); | ||
await user.type( | ||
screen.getByLabelText("Confirm email address"), | ||
"[email protected]", | ||
); | ||
|
||
expect(window.location.href).not.toContain("sessionId"); | ||
expect(window.location.href).not.toContain(sessionId); | ||
|
||
await user.click(screen.getByTestId("continue-button")); | ||
|
||
await waitFor(() => { | ||
expect(screen.getByText("Testing 123")).toBeInTheDocument(); | ||
}); | ||
|
||
expect(window.location.href).toContain(`sessionId=${sessionId}`); | ||
}); | ||
}); | ||
|
||
describe("ConfirmEmail component", () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters