summaryrefslogtreecommitdiffstats
path: root/models/twofactor.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-05-02 18:02:02 +0300
committerGitHub <noreply@github.com>2018-05-02 18:02:02 +0300
commit1e1ece8f3dce8ed9958f3bd5823c135d1c19eb49 (patch)
treeea20ecae0125334774662796a667570b71bbdd99 /models/twofactor.go
parentc58e1e437bafe2023b34c16d03f22764ece94d38 (diff)
downloadgitea-1e1ece8f3dce8ed9958f3bd5823c135d1c19eb49.tar.gz
gitea-1e1ece8f3dce8ed9958f3bd5823c135d1c19eb49.zip
Do not allow to reuse TOTP passcode (#3878)
Diffstat (limited to 'models/twofactor.go')
-rw-r--r--models/twofactor.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/models/twofactor.go b/models/twofactor.go
index 789315021e..5f3c6efc21 100644
--- a/models/twofactor.go
+++ b/models/twofactor.go
@@ -23,12 +23,13 @@ import (
// TwoFactor represents a two-factor authentication token.
type TwoFactor struct {
- ID int64 `xorm:"pk autoincr"`
- UID int64 `xorm:"UNIQUE"`
- Secret string
- ScratchToken string
- CreatedUnix util.TimeStamp `xorm:"INDEX created"`
- UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`
+ ID int64 `xorm:"pk autoincr"`
+ UID int64 `xorm:"UNIQUE"`
+ Secret string
+ ScratchToken string
+ LastUsedPasscode string `xorm:"VARCHAR(10)"`
+ CreatedUnix util.TimeStamp `xorm:"INDEX created"`
+ UpdatedUnix util.TimeStamp `xorm:"INDEX updated"`
}
// GenerateScratchToken recreates the scratch token the user is using.