fixed GetTOTP, started rough QR code implementation

GetTOTP handles TOTP method retrieval for confirmation and deletion.

QR code implementation looks like it's gonna suck, so might end up
using a library for this later.
This commit is contained in:
ari melody 2025-01-26 00:48:19 +00:00
parent ad39e68cd6
commit 1edc051ae2
Signed by: ari
GPG key ID: CF99829C92678188
5 changed files with 132 additions and 13 deletions

View file

@ -89,7 +89,6 @@ func main() {
}
username := os.Args[2]
totpName := os.Args[3]
secret := controller.GenerateTOTPSecret(controller.TOTP_SECRET_LENGTH)
account, err := controller.GetAccountByUsername(app.DB, username)
if err != nil {
@ -102,6 +101,7 @@ func main() {
os.Exit(1)
}
secret := controller.GenerateTOTPSecret(controller.TOTP_SECRET_LENGTH)
totp := model.TOTP {
AccountID: account.ID,
Name: totpName,