mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-27 11:14:59 +00:00
* feat(auth): add email-based password reset with SMTP config docs * test(e2e): stabilize password reset flow * test(e2e): isolate password reset rate limits * test(ci): stabilize backend and register e2e * docs(auth): sanitize smtp setup examples
16 lines
565 B
TypeScript
16 lines
565 B
TypeScript
import type { Page } from '@playwright/test'
|
|
|
|
export async function setEnglishLocale(page: Page) {
|
|
await page.addInitScript(() => {
|
|
window.localStorage.setItem('i18nextLng', 'en')
|
|
})
|
|
}
|
|
|
|
export async function setUniqueClientIp(page: Page, seed: string) {
|
|
const suffix = Date.now() + Math.floor(Math.random() * 1000)
|
|
const thirdOctet = seed.split('').reduce((sum, char) => sum + char.charCodeAt(0), 0) % 250
|
|
const fourthOctet = suffix % 250
|
|
await page.context().setExtraHTTPHeaders({
|
|
'X-Forwarded-For': `10.0.${thirdOctet}.${fourthOctet}`,
|
|
})
|
|
}
|