sec51 / twofactor

Golang two factor authentication library
ISC License
217 stars 66 forks source link

Make Totp.url() public #33

Closed insomniacslk closed 5 months ago

insomniacslk commented 1 year ago

So that it can be used by code that needs to expose the URL through means other than the PNG image returned by Totp.QR().

insomniacslk commented 1 year ago

This is a PR and a feedback request at the same time.

Currently only the Totp.QR() method exposes the URL to enroll a new user, but as a PNG. I think it is convenient to also expose the URL directly, so that it can be used to enroll a user via other means (for example by showing the QR on a terminal). I don't know if Totp.url() is private by intentional design, but in such case I'm interested to learn more.

Thanks in advance!