Fixed broken auth/i18n tests
This commit is contained in:
@@ -45,6 +45,6 @@ func Test_logoutProc(t *testing.T) {
|
||||
rq.Empty(authReq.Session.Values)
|
||||
rq.Empty(authReq.AuthUser)
|
||||
rq.Empty(authReq.Client)
|
||||
rq.Equal("/back", authReq.Data["backlink"])
|
||||
rq.Equal("/back", authReq.Data["link"])
|
||||
rq.Equal(TmplLogout, authReq.Template)
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ func (h AuthHandlers) mfaForm(req *request.AuthReq) (err error) {
|
||||
|
||||
t := translator(req, "auth")
|
||||
|
||||
req.PushAlert(t("mfa.handle.email-resent"))
|
||||
req.PushAlert(t("mfa.email.resent"))
|
||||
req.RedirectTo = GetLinks().Mfa
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ func Test_mfaProc(t *testing.T) {
|
||||
{
|
||||
name: "Email: successful login",
|
||||
payload: map[string]string(nil),
|
||||
alerts: []request.Alert{{Type: "primary", Text: "mfa.handle.email-resent"}},
|
||||
alerts: []request.Alert{{Type: "primary", Text: "mfa.email.resent"}},
|
||||
link: GetLinks().Profile,
|
||||
fn: func(_ *settings.Settings) {
|
||||
req.Form.Set("action", "verifyEmailOtp")
|
||||
@@ -47,7 +47,7 @@ func Test_mfaProc(t *testing.T) {
|
||||
{
|
||||
name: "TOTP: successful login",
|
||||
payload: map[string]string(nil),
|
||||
alerts: []request.Alert{{Type: "primary", Text: "mfa.handle.topt-valid"}},
|
||||
alerts: []request.Alert{{Type: "primary", Text: "mfa.topt.valid"}},
|
||||
link: GetLinks().Mfa,
|
||||
fn: func(_ *settings.Settings) {
|
||||
req.Form.Set("action", "verifyTotp")
|
||||
|
||||
@@ -158,5 +158,5 @@ func Test_securityProcDisableEmailOTPSuccess(t *testing.T) {
|
||||
err := authHandlers.securityProc(authReq)
|
||||
|
||||
rq.NoError(err)
|
||||
rq.Equal([]request.Alert{{Type: "primary", Text: "security.TFA-TOTP-disabled", Html: ""}}, authReq.NewAlerts)
|
||||
rq.Equal([]request.Alert{{Type: "primary", Text: "security.totp-disabled", Html: ""}}, authReq.NewAlerts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user