Package auth is a middleware that provides request authentication for Flamego.
go get github.com/flamego/auth
package main import ( "github.com/flamego/auth" "github.com/flamego/flamego" ) func main() { f := flamego.Classic() f.Use(auth.Basic("username", "secretpassword")) f.Get("/", func(user auth.User) string { return "Welcome, " + string(user) }) f.Run() }
- Read documentation and examples.
- Please file an issue or start a discussion on the flamego/flamego repository.
This project is under the MIT License. See the LICENSE file for the full license text.