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.