aboutsummaryrefslogtreecommitdiff
path: root/internal/db/two_factors.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/two_factors.go')
-rw-r--r--internal/db/two_factors.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/two_factors.go b/internal/db/two_factors.go
index 2dba2a02..6125dda7 100644
--- a/internal/db/two_factors.go
+++ b/internal/db/two_factors.go
@@ -32,8 +32,8 @@ type TwoFactorsStore interface {
// GetByUserID returns the 2FA token of given user. It returns
// ErrTwoFactorNotFound when not found.
GetByUserID(ctx context.Context, userID int64) (*TwoFactor, error)
- // IsUserEnabled returns true if the user has enabled 2FA.
- IsUserEnabled(ctx context.Context, userID int64) bool
+ // IsEnabled returns true if the user has enabled 2FA.
+ IsEnabled(ctx context.Context, userID int64) bool
}
var TwoFactors TwoFactorsStore
@@ -114,7 +114,7 @@ func (db *twoFactors) GetByUserID(ctx context.Context, userID int64) (*TwoFactor
return tf, nil
}
-func (db *twoFactors) IsUserEnabled(ctx context.Context, userID int64) bool {
+func (db *twoFactors) IsEnabled(ctx context.Context, userID int64) bool {
var count int64
err := db.WithContext(ctx).Model(new(TwoFactor)).Where("user_id = ?", userID).Count(&count).Error
if err != nil {