How to use the vk-io.CaptchaType.IMPLICIT_FLOW_AUTH function in vk-io

To help you get started, we’ve selected a few vk-io examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github negezor / vk-io / packages / authorization / src / providers / implicit-flow.ts View on Github external
code: FAILED_PASSED_CAPTCHA
			});
		}

		const { login, password, phone } = this.options;

		const { action, fields } = parseFormField($);

		fields.email = login || phone;
		fields.pass = password;

		if ('captcha_sid' in fields) {
			const src = $('.oauth_captcha').attr('src') || $('#captcha').attr('src');

			const { key, validate } = await this.vk.callbackService.processingCaptcha({
				type: CaptchaType.IMPLICIT_FLOW_AUTH,
				sid: fields.captcha_sid,
				src
			});

			this.captchaValidate = validate;

			fields.captcha_key = key;
		}

		debug('Fields', fields);

		const url = new URL(action);

		url.searchParams.set('utf8', '1');

		const pageResponse = await this.fetch(url, {