Process authentication auth data as map

This commit is contained in:
Tobie Morgan Hitchcock 2016-11-22 19:11:33 +00:00
parent 75b5f2f412
commit 2406256417
2 changed files with 5 additions and 5 deletions

View file

@ -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

View file

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