Skip to content

Commit

Permalink
Fixing redirects to be absolute rather than relative
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Jan 16, 2024
1 parent 2921b10 commit 9cbc5c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func (r *AdminRepo) EditElection(c echo.Context) error {
return r.errorHandle(c, err)
}

return c.Redirect(http.StatusFound, fmt.Sprintf("admin/election/%d", election.GetId()))
return c.Redirect(http.StatusFound, fmt.Sprintf("/admin/election/%d", election.GetId()))
}

func (r *AdminRepo) OpenElection(c echo.Context) error {
Expand Down Expand Up @@ -455,7 +455,7 @@ func (r *AdminRepo) OpenElection(c echo.Context) error {

go r.sendEmailThread(voters, election)

return c.Redirect(http.StatusFound, fmt.Sprintf("admin/election/%d", election.GetId()))
return c.Redirect(http.StatusFound, fmt.Sprintf("/admin/election/%d", election.GetId()))
}

func (r *AdminRepo) sendEmailThread(voters []*storage.Voter, election *storage.Election) {
Expand Down Expand Up @@ -620,7 +620,7 @@ func (r *AdminRepo) CloseElection(c echo.Context) error {
return r.errorHandle(c, err)
}

return c.Redirect(http.StatusFound, fmt.Sprintf("admin/election/%d", election.GetId()))
return c.Redirect(http.StatusFound, fmt.Sprintf("/admin/election/%d", election.GetId()))
}

func (r *AdminRepo) Exclude(c echo.Context) error {
Expand Down

0 comments on commit 9cbc5c4

Please sign in to comment.