mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 11:46:43 +01:00
added return clause after redirection.
This commit is contained in:
parent
bfd96c9373
commit
634f69b2c5
@ -36,6 +36,7 @@ func (idc *ItemDetailController) Get() {
|
||||
if projectId <= 0 {
|
||||
beego.Error("Invalid project id:", projectId)
|
||||
idc.Redirect("/signIn", http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
project, err := dao.GetProjectById(projectId)
|
||||
@ -47,12 +48,14 @@ func (idc *ItemDetailController) Get() {
|
||||
|
||||
if project == nil {
|
||||
idc.Redirect("/signIn", http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
sessionUserId := idc.GetSession("userId")
|
||||
|
||||
if project.Public != 1 && sessionUserId == nil {
|
||||
idc.Redirect("/signIn?uri="+url.QueryEscape(idc.Ctx.Input.URI()), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
if sessionUserId != nil {
|
||||
@ -68,6 +71,7 @@ func (idc *ItemDetailController) Get() {
|
||||
|
||||
if project.Public == 0 && len(roleList) == 0 {
|
||||
idc.Redirect("/registry/project", http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
if len(roleList) > 0 {
|
||||
|
@ -36,6 +36,7 @@ func (cpc *ChangePasswordController) Get() {
|
||||
sessionUserId := cpc.GetSession("userId")
|
||||
if sessionUserId == nil {
|
||||
cpc.Redirect("/signIn", http.StatusFound)
|
||||
return
|
||||
}
|
||||
cpc.Data["Username"] = cpc.GetSession("username")
|
||||
cpc.ForwardTo("page_title_change_password", "change-password")
|
||||
@ -179,6 +180,7 @@ func (rpc *ResetPasswordController) Get() {
|
||||
if resetUuid == "" {
|
||||
beego.Error("Reset uuid is blank.")
|
||||
rpc.Redirect("/", http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
queryUser := models.User{ResetUuid: resetUuid}
|
||||
|
Loading…
Reference in New Issue
Block a user