Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dustinbolton opened this issue Nov 29, 2012 · 1 comment
Open

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

dustinbolton opened this issue Nov 29, 2012 · 1 comment

Comments

@dustinbolton
Copy link

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;
        
    }
@andreszs
Copy link

You are right, the code should be updated to reflect the new Google APIs URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants