From 127907c5e66d671b139a8d2bd8912911c7e58347 Mon Sep 17 00:00:00 2001
From: Ash McKenzie <ash@the-rebellion.net>
Date: Mon, 18 Jan 2021 19:51:32 +1100
Subject: [PATCH] Allow passcode invalid error to appear (#14371)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
---
 routers/user/setting/security_twofa.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/routers/user/setting/security_twofa.go b/routers/user/setting/security_twofa.go
index 4ee698e15..925fc2a44 100644
--- a/routers/user/setting/security_twofa.go
+++ b/routers/user/setting/security_twofa.go
@@ -195,7 +195,7 @@ func EnrollTwoFactorPost(ctx *context.Context, form auth.TwoFactorAuthForm) {
 			return
 		}
 		ctx.Flash.Error(ctx.Tr("settings.passcode_invalid"))
-		ctx.HTML(200, tplSettingsTwofaEnroll)
+		ctx.Redirect(setting.AppSubURL + "/user/settings/security/two_factor/enroll")
 		return
 	}