mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 13:22:09 +08:00
Using types intstead of several type in auth file
This commit is contained in:
parent
b57163a0e4
commit
83197b1ebb
16
auth.go
16
auth.go
@ -16,15 +16,17 @@ import (
|
||||
// AuthUserKey is the cookie name for user credential in basic auth.
|
||||
const AuthUserKey = "user"
|
||||
|
||||
// Accounts defines a key/value for user/pass list of authorized logins.
|
||||
type Accounts map[string]string
|
||||
type (
|
||||
// Accounts defines a key/value for user/pass list of authorized logins.
|
||||
Accounts map[string]string
|
||||
|
||||
type authPair struct {
|
||||
value string
|
||||
user string
|
||||
}
|
||||
authPair struct {
|
||||
value string
|
||||
user string
|
||||
}
|
||||
|
||||
type authPairs []authPair
|
||||
authPairs []authPair
|
||||
)
|
||||
|
||||
func (a authPairs) searchCredential(authValue string) (string, bool) {
|
||||
if authValue == "" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user