Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ auth Public

Package auth is a middleware that provides request authentication for Flamego

License

Notifications You must be signed in to change notification settings

flamego/auth

Repository files navigation

auth

GitHub Workflow Status GoDoc

Package auth is a middleware that provides request authentication for Flamego.

Installation

go get github.com/flamego/auth

Getting started

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()
}

Getting help

License

This project is under the MIT License. See the LICENSE file for the full license text.

About

Package auth is a middleware that provides request authentication for Flamego

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /