drive-health/lib/web/auth_middleware.go

12 lines
209 B
Go
Raw Normal View History

package web
import "github.com/gin-gonic/gin"
func BasicAuthMiddleware(username, password string) gin.HandlerFunc {
authorized := gin.Accounts{
username: password,
}
return gin.BasicAuth(authorized)
}