* Add a /user/login landing page option * Add test case for login landing pagetags/v1.11.0-rc1
@@ -186,7 +186,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. | |||||
- `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path. | - `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path. | ||||
- `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars. | - `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars. | ||||
- `ENABLE_GZIP`: **false**: Enables application-level GZIP support. | - `ENABLE_GZIP`: **false**: Enables application-level GZIP support. | ||||
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore\]. | |||||
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login\]. | |||||
- `LFS_START_SERVER`: **false**: Enables git-lfs support. | - `LFS_START_SERVER`: **false**: Enables git-lfs support. | ||||
- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files. | - `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files. | ||||
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string. | - `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string. | ||||
@@ -99,5 +99,10 @@ func TestSettingLandingPage(t *testing.T) { | |||||
resp = MakeRequest(t, req, http.StatusFound) | resp = MakeRequest(t, req, http.StatusFound) | ||||
assert.Equal(t, "/explore/organizations", resp.Header().Get("Location")) | assert.Equal(t, "/explore/organizations", resp.Header().Get("Location")) | ||||
setting.LandingPageURL = setting.LandingPageLogin | |||||
req = NewRequest(t, "GET", "/") | |||||
resp = MakeRequest(t, req, http.StatusFound) | |||||
assert.Equal(t, "/user/login", resp.Header().Get("Location")) | |||||
setting.LandingPageURL = landingPage | setting.LandingPageURL = landingPage | ||||
} | } |
@@ -54,6 +54,7 @@ const ( | |||||
LandingPageHome LandingPage = "/" | LandingPageHome LandingPage = "/" | ||||
LandingPageExplore LandingPage = "/explore" | LandingPageExplore LandingPage = "/explore" | ||||
LandingPageOrganizations LandingPage = "/explore/organizations" | LandingPageOrganizations LandingPage = "/explore/organizations" | ||||
LandingPageLogin LandingPage = "/user/login" | |||||
) | ) | ||||
// enumerates all the types of captchas | // enumerates all the types of captchas | ||||
@@ -648,6 +649,8 @@ func NewContext() { | |||||
LandingPageURL = LandingPageExplore | LandingPageURL = LandingPageExplore | ||||
case "organizations": | case "organizations": | ||||
LandingPageURL = LandingPageOrganizations | LandingPageURL = LandingPageOrganizations | ||||
case "login": | |||||
LandingPageURL = LandingPageLogin | |||||
default: | default: | ||||
LandingPageURL = LandingPageHome | LandingPageURL = LandingPageHome | ||||
} | } | ||||