1
0
forked from baron/baron-sso

fix userfront verify-only approval routing

This commit is contained in:
2026-05-21 14:33:40 +09:00
parent d56c041b67
commit eb46918397
2 changed files with 49 additions and 5 deletions

View File

@@ -112,6 +112,19 @@ async function mockUserfrontApis(
return;
}
if (
path.endsWith('/api/v1/auth/magic-link/verify') ||
path.endsWith('/api/v1/auth/login/code/verify') ||
path.endsWith('/api/v1/auth/login/code/verify-short')
) {
await route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ status: 'approved', pendingRef: 'e2e-approved' }),
});
return;
}
await route.fulfill({
status: 200,
contentType: 'application/json',
@@ -179,4 +192,24 @@ test.describe('UserFront WASM auth routing', () => {
});
expect(approvedRef).toBe('e2e-approve-ref');
});
test('verifyOnly 승인 완료 화면의 상단 액션은 signin으로 이동시키지 않는다', async ({
page,
}) => {
await mockUserfrontApis(page, { sessionStatus: 401 });
await page.goto('/ko/l/AB123456');
await expect(page).toHaveURL(/\/ko\/l\/AB123456$/);
await page.waitForTimeout(500);
await expect(page).toHaveURL(/\/ko\/l\/AB123456$/);
await page.locator('flt-glass-pane').click({
position: { x: 30, y: 28 },
force: true,
});
await page.waitForTimeout(300);
await expect(page).toHaveURL(/\/ko\/l\/AB123456$/);
});
});