Refactor: Update README to indicate Account Creator is in BETA; improve error messages for recoveryEmail validation

This commit is contained in:
2025-11-08 18:37:32 +01:00
parent 52fbbd79b1
commit ca356075fa
3 changed files with 7 additions and 7 deletions

View File

@@ -126,7 +126,7 @@ Access at `http://localhost:3000` to:
--- ---
## 🆕 Account Creator ## 🆕 Account Creator (BETA)
Automatically create new Microsoft accounts with referral link support: Automatically create new Microsoft accounts with referral link support:

View File

@@ -1,10 +1,10 @@
import type { Page, BrowserContext } from 'playwright'
import { log } from '../util/Logger'
import { DataGenerator } from './DataGenerator'
import { CreatedAccount } from './types'
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import * as readline from 'readline' import * as readline from 'readline'
import type { BrowserContext, Page } from 'rebrowser-playwright'
import { log } from '../util/Logger'
import { DataGenerator } from './DataGenerator'
import { CreatedAccount } from './types'
export class AccountCreator { export class AccountCreator {
private page!: Page private page!: Page

View File

@@ -362,11 +362,11 @@ export function loadAccounts(): Account[] {
if (recoveryRequired) { if (recoveryRequired) {
if (typeof a.recoveryEmail !== 'string') { if (typeof a.recoveryEmail !== 'string') {
throw new Error(`account ${a.email || '<unknown>'} must include a recoveryEmail string`) throw new Error(`account ${a.email || '<unknown>'} must include a recoveryEmail string (or set "recoveryRequired": false)`)
} }
a.recoveryEmail = String(a.recoveryEmail).trim() a.recoveryEmail = String(a.recoveryEmail).trim()
if (!a.recoveryEmail || !/@/.test(a.recoveryEmail)) { if (!a.recoveryEmail || !/@/.test(a.recoveryEmail)) {
throw new Error(`account ${a.email} recoveryEmail must be a valid email address`) throw new Error(`account ${a.email} recoveryEmail must be a valid email address (got: "${a.recoveryEmail}") - set "recoveryRequired": false if not needed`)
} }
} else { } else {
if (typeof a.recoveryEmail === 'string' && a.recoveryEmail.trim() !== '') { if (typeof a.recoveryEmail === 'string' && a.recoveryEmail.trim() !== '') {