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 {
|
type Auth struct {
|
||||||
Kind int
|
Kind int
|
||||||
Data interface{}
|
Data map[string]interface{}
|
||||||
Possible struct {
|
Possible struct {
|
||||||
NS string
|
NS string
|
||||||
DB string
|
DB string
|
||||||
|
|
|
@ -122,6 +122,10 @@ func auth() fibre.MiddlewareFunc {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if val, ok := vars["auth"].(map[string]interface{}); ok {
|
||||||
|
auth.Data = val
|
||||||
|
}
|
||||||
|
|
||||||
nsv, nok = vars["NS"].(string) // Namespace
|
nsv, nok = vars["NS"].(string) // Namespace
|
||||||
dbv, dok = vars["DB"].(string) // Database
|
dbv, dok = vars["DB"].(string) // Database
|
||||||
scv, sok = vars["SC"].(string) // Scope
|
scv, sok = vars["SC"].(string) // Scope
|
||||||
|
@ -208,10 +212,6 @@ func auth() fibre.MiddlewareFunc {
|
||||||
auth.Selected.DB = dbv
|
auth.Selected.DB = dbv
|
||||||
}
|
}
|
||||||
|
|
||||||
if val, ok := vars["auth"]; ok {
|
|
||||||
auth.Data = val
|
|
||||||
}
|
|
||||||
|
|
||||||
return h(c)
|
return h(c)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue