aboutsummaryrefslogtreecommitdiffstats
path: root/modules/auth/user_form.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/auth/user_form.go')
-rw-r--r--modules/auth/user_form.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go
index 1fa5b55c67..0f083a2e00 100644
--- a/modules/auth/user_form.go
+++ b/modules/auth/user_form.go
@@ -173,3 +173,23 @@ type NewAccessTokenForm struct {
func (f *NewAccessTokenForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
+
+// TwoFactorAuthForm for logging in with 2FA token.
+type TwoFactorAuthForm struct {
+ Passcode string `binding:"Required"`
+}
+
+// Validate valideates the fields
+func (f *TwoFactorAuthForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+ return validate(errs, ctx.Data, f, ctx.Locale)
+}
+
+// TwoFactorScratchAuthForm for logging in with 2FA scratch token.
+type TwoFactorScratchAuthForm struct {
+ Token string `binding:"Required"`
+}
+
+// Validate valideates the fields
+func (f *TwoFactorScratchAuthForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+ return validate(errs, ctx.Data, f, ctx.Locale)
+}