authelia/internal/handlers/handler_extended_configuration.go
Amir Zarrinkafsh fabb76754e
Rename org from clems4ever to authelia
Also fix references from config.yml to configuration.yml
2019-12-24 13:14:52 +11:00

24 lines
723 B
Go

package handlers
import (
"github.com/authelia/authelia/internal/authentication"
"github.com/authelia/authelia/internal/middlewares"
)
type ExtendedConfigurationBody struct {
AvailableMethods MethodList `json:"available_methods"`
}
// ExtendedConfigurationGet get the extended configuration accessbile to authenticated users.
func ExtendedConfigurationGet(ctx *middlewares.AutheliaCtx) {
body := ExtendedConfigurationBody{}
body.AvailableMethods = MethodList{authentication.TOTP, authentication.U2F}
if ctx.Configuration.DuoAPI != nil {
body.AvailableMethods = append(body.AvailableMethods, authentication.Push)
}
ctx.Logger.Debugf("Available methods are %s", body.AvailableMethods)
ctx.SetJSONBody(body)
}