mirror of
https://github.com/go-gitea/gitea
synced 2025-07-26 04:08:35 +00:00
Add post-installation redirect based on admin account status (#34493)
This PR adds a feature to direct users to appropriate pages after system installation: - If no admin credentials were provided during installation, redirect to the registration page with a prominent notice about creating the first administrative account - If admin credentials were already set, redirect directly to the login page  --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -601,5 +601,7 @@ func SubmitInstall(ctx *context.Context) {
|
||||
// InstallDone shows the "post-install" page, makes it easier to develop the page.
|
||||
// The name is not called as "PostInstall" to avoid misinterpretation as a handler for "POST /install"
|
||||
func InstallDone(ctx *context.Context) { //nolint
|
||||
hasUsers, _ := user_model.HasUsers(ctx)
|
||||
ctx.Data["IsAccountCreated"] = hasUsers.HasAnyUser
|
||||
ctx.HTML(http.StatusOK, tplPostInstall)
|
||||
}
|
||||
|
Reference in New Issue
Block a user