diff options
Diffstat (limited to 'models/twofactor.go')
-rw-r--r-- | models/twofactor.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/twofactor.go b/models/twofactor.go index 00a465353a..888c910b94 100644 --- a/models/twofactor.go +++ b/models/twofactor.go @@ -142,8 +142,8 @@ func UpdateTwoFactor(t *TwoFactor) error { // GetTwoFactorByUID returns the two-factor authentication token associated with // the user, if any. func GetTwoFactorByUID(uid int64) (*TwoFactor, error) { - twofa := &TwoFactor{UID: uid} - has, err := x.Get(twofa) + twofa := &TwoFactor{} + has, err := x.Where("uid=?", uid).Get(twofa) if err != nil { return nil, err } else if !has { |