From fe3b1c9b52f584b0f045907585b206344fed55db Mon Sep 17 00:00:00 2001 From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com> Date: Thu, 8 May 2025 21:20:58 +0700 Subject: chore: implement 2fa auth (#2968) * chore: implement 2fa auth from #2786 * chore: format code * chore: replace two factor token input with qr-code * chore: requesting confirmation of setting/removing two-factor authentication otpauth library was taken from cdnjs * chore: revert changes in `ClipboardManager` don't need it. * chore: removing twoFactor prop in settings page * chore: remove `twoFactorQr` object in `mounted` function --- database/db.go | 6 ++---- database/model/model.go | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'database') diff --git a/database/db.go b/database/db.go index 2fe18478..c72d28cf 100644 --- a/database/db.go +++ b/database/db.go @@ -24,7 +24,6 @@ var db *gorm.DB const ( defaultUsername = "admin" defaultPassword = "admin" - defaultSecret = "" ) func initModels() error { @@ -61,9 +60,8 @@ func initUser() error { } user := &model.User{ - Username: defaultUsername, - Password: hashedPassword, - LoginSecret: defaultSecret, + Username: defaultUsername, + Password: hashedPassword, } return db.Create(user).Error } diff --git a/database/model/model.go b/database/model/model.go index 7a20de16..2e7095d3 100644 --- a/database/model/model.go +++ b/database/model/model.go @@ -21,10 +21,9 @@ const ( ) type User struct { - Id int `json:"id" gorm:"primaryKey;autoIncrement"` - Username string `json:"username"` - Password string `json:"password"` - LoginSecret string `json:"loginSecret"` + Id int `json:"id" gorm:"primaryKey;autoIncrement"` + Username string `json:"username"` + Password string `json:"password"` } type Inbound struct { -- cgit v1.2.3