fix args in db queries
This commit is contained in:
parent
bc7f26f14d
commit
5eefd1b4d3
2 changed files with 4 additions and 3 deletions
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version = "1.0.8"
|
version = "1.0.9"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -213,7 +213,7 @@ func (oUser *OpenvpnUser) RegisterOtpApplication(username, totp string) (string,
|
||||||
return "", authErr
|
return "", authErr
|
||||||
}
|
}
|
||||||
if authOk {
|
if authOk {
|
||||||
_, err := oUser.Database.Exec("UPDATE users SET app_configured = 1 WHERE username = $2")
|
_, err := oUser.Database.Exec("UPDATE users SET app_configured = 1 WHERE username = $1", username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ func (oUser *OpenvpnUser) ResetOtpApplication(username string) (string, error) {
|
||||||
return "", appErr
|
return "", appErr
|
||||||
}
|
}
|
||||||
if appConfigured {
|
if appConfigured {
|
||||||
_, err := oUser.Database.Exec("UPDATE users SET app_configured = 0 WHERE username = $2")
|
_, err := oUser.Database.Exec("UPDATE users SET app_configured = 0 WHERE username = $1", username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -263,6 +263,7 @@ func (oUser *OpenvpnUser) IsSecondFactorEnabled(username string) (bool, error) {
|
||||||
if u.name == username {
|
if u.name == username {
|
||||||
return u.appConfigured, nil
|
return u.appConfigured, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, checkAppError
|
return false, checkAppError
|
||||||
}
|
}
|
||||||
return false, userIsNotActiveError
|
return false, userIsNotActiveError
|
||||||
|
|
Loading…
Reference in a new issue