fix redirect after sending the peer email

This commit is contained in:
Christoph Haas 2021-03-22 13:45:35 +01:00
parent 1e9f845457
commit 68507c3bcd
1 changed files with 5 additions and 1 deletions

View File

@ -301,7 +301,11 @@ func (s *Server) GetPeerConfigMail(c *gin.Context) {
} }
SetFlashMessage(c, "mail sent successfully", "success") SetFlashMessage(c, "mail sent successfully", "success")
c.Redirect(http.StatusSeeOther, "/admin") if strings.HasPrefix(c.Request.URL.Path, "/user") {
c.Redirect(http.StatusSeeOther, "/user/profile")
} else {
c.Redirect(http.StatusSeeOther, "/admin")
}
} }
func (s *Server) GetPeerStatus(c *gin.Context) { func (s *Server) GetPeerStatus(c *gin.Context) {