fix loading ofr login form and redirects.
This commit is contained in:
@@ -17,7 +17,7 @@ func Auth(required bool) func(http.HandlerFunc) http.HandlerFunc {
|
||||
_, ok := session.Values["user_id"].(int)
|
||||
|
||||
if required && !ok {
|
||||
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/account/login", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ func Auth(required bool) func(http.HandlerFunc) http.HandlerFunc {
|
||||
newSession.Values["flash"] = "Your session has timed out."
|
||||
newSession.Save(r, w)
|
||||
|
||||
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/account/login", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user