route-auth

Auth Middleware for session & white-listed routing

Example

// White listed routes
var WhiteListRoutes = [][]string{
    {
    "/", "GET",
    },
    {
    "/uploads/adverts/*", "GET",
    },
    {
    "/public/*", "GET",
    },
}


r := mux.NewRouter() // gorilla's mux router
r.Use(Authenticate(WhiteListRoutes))

GitHub

View Github