mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
54694c4fca
* [MISC] Ignore errcheck recommendations for legacy code Some of this is likely intended to stay how it is, some could use refactoring, for now we will mark is and ignore it from the linter to be potentially addressed in the future. * [MISC] Ensure files are gofmt-ed
21 lines
912 B
Go
21 lines
912 B
Go
package handlers
|
|
|
|
import "github.com/authelia/authelia/internal/middlewares"
|
|
|
|
// ConfigurationBody configuration parameters exposed to the frontend.
|
|
type ConfigurationBody struct {
|
|
GoogleAnalyticsTrackingID string `json:"ga_tracking_id,omitempty"`
|
|
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{
|
|
GoogleAnalyticsTrackingID: ctx.Configuration.GoogleAnalyticsTrackingID,
|
|
RememberMe: ctx.Providers.SessionProvider.RememberMe != 0,
|
|
ResetPassword: !ctx.Configuration.AuthenticationBackend.DisableResetPassword,
|
|
}
|
|
ctx.SetJSONBody(body) //nolint:errcheck // TODO: Legacy code, consider refactoring time permitting.
|
|
}
|