diff --git a/integrations/setting_test.go b/integrations/setting_test.go index a8d1f01e8..2aac8e90e 100644 --- a/integrations/setting_test.go +++ b/integrations/setting_test.go @@ -68,3 +68,25 @@ func TestSettingShowUserEmailProfile(t *testing.T) { setting.UI.ShowUserEmail = showUserEmail } + +func TestSettingLandingPage(t *testing.T) { + prepareTestEnv(t) + + landingPage := setting.LandingPageURL + + setting.LandingPageURL = setting.LandingPageHome + req := NewRequest(t, "GET", "/") + MakeRequest(t, req, http.StatusOK) + + setting.LandingPageURL = setting.LandingPageExplore + req = NewRequest(t, "GET", "/") + resp := MakeRequest(t, req, http.StatusFound) + assert.Equal(t, "/explore", resp.Header().Get("Location")) + + setting.LandingPageURL = setting.LandingPageOrganizations + req = NewRequest(t, "GET", "/") + resp = MakeRequest(t, req, http.StatusFound) + assert.Equal(t, "/explore/organizations", resp.Header().Get("Location")) + + setting.LandingPageURL = landingPage +} diff --git a/modules/context/auth.go b/modules/context/auth.go index 372bcb187..c38cc3948 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -37,12 +37,6 @@ func Toggle(options *ToggleOptions) macaron.Handler { return } - // Check non-logged users landing page. - if !ctx.IsSigned && ctx.Req.RequestURI == "/" && setting.LandingPageURL != setting.LandingPageHome { - ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL)) - return - } - // Redirect to dashboard if user tries to visit any non-login page. if options.SignOutRequired && ctx.IsSigned && ctx.Req.RequestURI != "/" { ctx.Redirect(setting.AppSubURL + "/") diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index 4e56b3028..364308424 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -213,6 +213,7 @@ send_reset_mail=E-Mail zum Passwort-zurücksetzen erneut verschicken reset_password=Passwort zurücksetzen invalid_code=Dein Bestätigungs-Code ist ungültig oder abgelaufen. reset_password_helper=Passwort zurückzusetzen +password_too_short=Das Passwort muss mindestens %d Zeichen lang sein. non_local_account=Benutzer, die nicht von Gitea verwaltet werden können ihre Passwörter nicht über das Web Interface ändern. verify=Verifizieren scratch_code=Einmalpasswort diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini index 3bc79cdd5..d59851e6a 100644 --- a/options/locale/locale_uk-UA.ini +++ b/options/locale/locale_uk-UA.ini @@ -38,6 +38,7 @@ u2f_use_twofa=Використовуйте дво-факторний код з u2f_error=Неможливо прочитати ваш ключ безпеки! u2f_unsupported_browser=Ваш браузер не підтримує U2F ключі. Будь ласка, спробуйте інший браузер. u2f_error_1=Сталася невідома помилка. Спробуйте ще раз. +u2f_error_2=Переконайтеся, що ви використовуєте зашифроване з'єднання (https://) та відвідуєте правильну URL-адресу. u2f_error_3=Сервер не може обробити, ваш запит. u2f_reload=Оновити @@ -398,7 +399,12 @@ generate_token=Згенерувати токен delete_token=Видалити access_token_deletion=Видалити токен доступу +twofa_desc=Двофакторна аутентифікація підвищує безпеку вашого облікового запису. +twofa_is_enrolled=Ваш обліковий запис в даний час використовує двофакторну автентифікацію. twofa_disable=Вимкнути двофакторну автентифікацію +twofa_enroll=Увімкнути двофакторну автентифікацію +twofa_disabled=Двофакторна автентифікація вимкнена. +scan_this_image=Проскануйте це зображення вашим додатком для двуфакторної аутентифікації: or_enter_secret=Або введіть секрет: %s passcode_invalid=Некоректний пароль. Спробуй ще раз. diff --git a/routers/home.go b/routers/home.go index 5bb353c7e..0aa907658 100644 --- a/routers/home.go +++ b/routers/home.go @@ -42,6 +42,10 @@ func Home(ctx *context.Context) { user.Dashboard(ctx) } return + // Check non-logged users landing page. + } else if setting.LandingPageURL != setting.LandingPageHome { + ctx.Redirect(setting.AppSubURL + string(setting.LandingPageURL)) + return } // Check auto-login.