Airship\Cabin\Bridge\Landing\Account::twoFactorSetupQRCode PHP Method

twoFactorSetupQRCode() public method

Returns the user's QR code.
    public function twoFactorSetupQRCode()
    {
        if (!$this->isLoggedIn()) {
            \Airship\redirect($this->airship_cabin_prefix);
        }
        $gauth = $this->twoFactorPreamble();
        $user = $this->acct->getUserAccount($this->getActiveUserId());
        if (\extension_loaded('gd')) {
            \header('Content-Type: image/png');
            $writer = null;
        } else {
            $renderer = new Svg();
            $renderer->setHeight(384);
            $renderer->setWidth(384);
            $writer = new QRCodeWriter($renderer);
            $this->airship_lens_object->sendStandardHeaders('image/svg+xml');
        }
        $gauth->makeQRCode($writer, 'php://output', $user['username'] . '@' . $_SERVER['HTTP_HOST'], $this->config('two-factor.issuer') ?? '', $this->config('two-factor.label') ?? '');
    }