cleaning err print statement
This commit is contained in:
@@ -111,7 +111,6 @@ func authMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
||||
func adminMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
||||
return authMiddleware(func(w http.ResponseWriter, r *http.Request) {
|
||||
role, ok := r.Context().Value("user_role").(int)
|
||||
fmt.Print(role)
|
||||
if !ok || role != 1 {
|
||||
http.Redirect(w, r, "/", http.StatusSeeOther)
|
||||
return
|
||||
@@ -124,7 +123,6 @@ func adminMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
||||
func volunteerMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
||||
return authMiddleware(func(w http.ResponseWriter, r *http.Request) {
|
||||
role, ok := r.Context().Value("user_role").(int)
|
||||
fmt.Print(role)
|
||||
if !ok || (role != 3 && role != 2) {
|
||||
fmt.Printf("Access denied: role %d not allowed\n", role) // Debug log
|
||||
http.Redirect(w, r, "/", http.StatusSeeOther)
|
||||
|
||||
Reference in New Issue
Block a user