1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-18 02:19:18 +00:00

Require password in singleUserScene

This commit is contained in:
Matt Gibson
2026-02-10 09:53:39 -08:00
parent 3d0793ad3a
commit f57a2e13f1
4 changed files with 8 additions and 5 deletions

View File

@@ -11,10 +11,10 @@ test.skip("login and save session", async ({ auth }) => {
await expectUnlockedAs(scene.mangle("test@example.com"), page);
});
test.skip("As long as the previous test ran in this worker, this time it will reuse authentication", async ({
test.only("As long as the previous test ran in this worker, this time it will reuse authentication", async ({
auth,
}) => {
const { page, scene } = await auth.authenticate("test@example.com", "asdfasdfasdf");
const { page, scene } = await auth.authenticate("test@example.com", "passwordpassword");
await expectUnlockedAs(scene.mangle("test@example.com"), page);
});

View File

@@ -46,7 +46,9 @@ type AuthenticatedContext = {
scene: SingleUserScene;
};
type SessionOptions = Simplify<Except<extractTUpType<SingleUserSceneTemplate>, "email">> & {
type SessionOptions = Simplify<
Except<extractTUpType<SingleUserSceneTemplate>, "email" | "password">
> & {
/** The page to use for authenticating */
page?: Page;
};
@@ -158,7 +160,7 @@ export class AuthFixture {
password: string,
options: SessionOptions = {},
): Promise<AuthenticatedContext> {
const scene = await Play.scene(new SingleUserSceneTemplate({ ...options, email }));
const scene = await Play.scene(new SingleUserSceneTemplate({ ...options, email, password }));
return await this.authenticateForScene(scene, password);
}

View File

@@ -16,6 +16,7 @@ type SceneResult = {
};
type UpParams = {
email: string;
password: string;
emailVerified?: boolean;
premium?: boolean;
};

View File

@@ -67,7 +67,7 @@ export async function cleanStage(): Promise<void> {
// eslint-disable-next-line no-console
console.warn(
"PLAYWRIGHT_SKIP_CLEAN_STAGE is set, run\n",
`curl -X DELETE ${new URL(playId, webServerBaseUrl).toString()}\n`,
`curl -X DELETE ${new URL(`/seed/${playId}`, webServerBaseUrl).toString()}\n`,
);
return;
}