From 2406256417b22d37f1986bfb7d0e38e52fe0e762 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Tue, 22 Nov 2016 19:11:33 +0000 Subject: [PATCH] Process authentication auth data as map --- cnf/cnf.go | 2 +- web/auth.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cnf/cnf.go b/cnf/cnf.go index 5d83e134..49fb8a77 100644 --- a/cnf/cnf.go +++ b/cnf/cnf.go @@ -18,7 +18,7 @@ var Settings *Options type Auth struct { Kind int - Data interface{} + Data map[string]interface{} Possible struct { NS string DB string diff --git a/web/auth.go b/web/auth.go index 2e25afc7..4b32aa5c 100644 --- a/web/auth.go +++ b/web/auth.go @@ -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) }