DoctorMcKay / node-steamstore

Home Page:https://www.npmjs.com/package/steamstore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missed "email_verification" op to complete adding phone number flow

snitovets opened this issue · comments

store.addPhoneNumber throws error.message "Unknown state email_verification" which successfully calls email send from steam.
After confirming intentions to add phone number. The next step is to request sms code which unfortunately is not implemented in package.

Though I manually request sms code:

private async requestSMSCode(): Promise<boolean> {
	const params = new URLSearchParams();
	params.append("op", "email_verification");
	params.append("input", "");
	params.append("sessionID", this.steam.sessionID);
	params.append("confirmed", "1");
	params.append("checkfortos", "1");
	params.append("bisediting", "0");
	params.append("token", "0");

	const {
		data: { success }
	} = await axios.post("https://store.steampowered.com/phone/add_ajaxop", params, {
		headers: {
			"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
			Cookie: this.steam.serializedCookies
		}
	});

	return success;
}