Process authentication auth data as map
This commit is contained in:
parent
75b5f2f412
commit
2406256417
2 changed files with 5 additions and 5 deletions
|
@ -18,7 +18,7 @@ var Settings *Options
|
|||
|
||||
type Auth struct {
|
||||
Kind int
|
||||
Data interface{}
|
||||
Data map[string]interface{}
|
||||
Possible struct {
|
||||
NS string
|
||||
DB string
|
||||
|
|
|
@ -122,6 +122,10 @@ func auth() fibre.MiddlewareFunc {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if val, ok := vars["auth"].(map[string]interface{}); ok {
|
||||
auth.Data = val
|
||||
}
|
||||
|
||||
nsv, nok = vars["NS"].(string) // Namespace
|
||||
dbv, dok = vars["DB"].(string) // Database
|
||||
scv, sok = vars["SC"].(string) // Scope
|
||||
|
@ -208,10 +212,6 @@ func auth() fibre.MiddlewareFunc {
|
|||
auth.Selected.DB = dbv
|
||||
}
|
||||
|
||||
if val, ok := vars["auth"]; ok {
|
||||
auth.Data = val
|
||||
}
|
||||
|
||||
return h(c)
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue