1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 14:49:42 +02:00

authConfig persistence bug, session vars bug

This commit is contained in:
Harvey Kandola 2017-04-13 16:22:19 +01:00
parent 585c4468c1
commit 6f98db5c29
8 changed files with 693 additions and 660 deletions

View file

@ -233,3 +233,21 @@ type authData struct {
AuthProvider string `json:"authProvider"`
AuthConfig string `json:"authConfig"`
}
// GetAuthConfig returns installation-wide auth configuration
func GetAuthConfig(w http.ResponseWriter, r *http.Request) {
p := request.GetPersister(r)
if !p.Context.Global {
writeForbiddenError(w)
return
}
org, err := p.GetOrganization(p.Context.OrgID)
if err != nil {
writeForbiddenError(w)
return
}
util.WriteJSON(w, org.AuthConfig)
}