From a3826b403905c36ba633ea484b9817f74015bd12 Mon Sep 17 00:00:00 2001 From: Adam Jenkins Date: Tue, 30 Dec 2025 19:24:29 -0330 Subject: [PATCH] MagicAuth --- tests/fixtures.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/fixtures.ts b/tests/fixtures.ts index 67ca654..fcc7a2b 100644 --- a/tests/fixtures.ts +++ b/tests/fixtures.ts @@ -72,11 +72,16 @@ async function authenticateUser( }); try { + // create a magic auth token + const magicAuthToken = await workos.userManagement.createMagicAuth({ + email, + }); + // Step 1: Get tokens from WorkOS API - const authResponse = await workos.userManagement.authenticateWithPassword({ + const authResponse = await workos.userManagement.authenticateWithMagicAuth({ clientId: workosClientId, + code: magicAuthToken.code, email, - password, }); // Step 2: Save session via our test endpoint