add optional prefix to url
This commit is contained in:
@@ -84,7 +84,7 @@ func (s *Server) CSRFRequire() gin.HandlerFunc {
|
||||
func (s *Server) RequireAuth() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
if _, exists := c.Get("user_id"); !exists {
|
||||
c.Redirect(http.StatusFound, "/editor/login")
|
||||
c.Redirect(http.StatusFound, s.config.URLPrefix+"/editor/login")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
@@ -96,7 +96,7 @@ func (s *Server) RequireAuth() gin.HandlerFunc {
|
||||
func (s *Server) RequireAdmin() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
if _, exists := c.Get("user_id"); !exists {
|
||||
c.Redirect(http.StatusFound, "/editor/login")
|
||||
c.Redirect(http.StatusFound, s.config.URLPrefix+"/editor/login")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user