Skip to content

QR code broken - getURL() function fix within #3

@dustinbolton

Description

@dustinbolton

It looks like both the QR code URL and some formatting changes are needed to get this to work correctly. Working function as of November 29, 2012:

public function getUrl($user, $hostname, $secret) {
        $url =  sprintf("otpauth://totp/%s@%s?secret=%s", $user, $hostname, $secret);
        $encoder = "https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=";
        $encoderURL = $encoder . urlencode( sprintf( "otpauth://totp/%s@%s?secret=%s", $user, $hostname, $secret) );
        
        return $encoderURL;
        
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions