authelia/internal/handlers/handler_configuration.go
James Elliott a4cf2e675f
[DEPRECATE] Remove Google Analytics (#1021)
* it doesn't work with our current CSP
* it's probably not used by anyone
* it isn't in harmony with our security purposes
* literally removes all use of it
* suggestions from code review
* remove useless test.

Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
2020-05-16 09:41:42 +10:00

19 lines
718 B
Go

package handlers
import "github.com/authelia/authelia/internal/middlewares"
// ConfigurationBody configuration parameters exposed to the frontend.
type ConfigurationBody struct {
RememberMe bool `json:"remember_me"` // whether remember me is enabled or not
ResetPassword bool `json:"reset_password"`
}
// ConfigurationGet fetches configuration parameters for frontend mutation.
func ConfigurationGet(ctx *middlewares.AutheliaCtx) {
body := ConfigurationBody{
RememberMe: ctx.Providers.SessionProvider.RememberMe != 0,
ResetPassword: !ctx.Configuration.AuthenticationBackend.DisableResetPassword,
}
ctx.SetJSONBody(body) //nolint:errcheck // TODO: Legacy code, consider refactoring time permitting.
}