mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 17:26:17 +00:00
Refactor: Update README to indicate Account Creator is in BETA; improve error messages for recoveryEmail validation
This commit is contained in:
@@ -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:
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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() !== '') {
|
||||||
|
|||||||
Reference in New Issue
Block a user