2019-04-25 04:52:08 +07:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
2019-12-24 09:14:52 +07:00
|
|
|
"github.com/authelia/authelia/internal/middlewares"
|
2019-04-25 04:52:08 +07:00
|
|
|
)
|
|
|
|
|
|
|
|
// StateGet is the handler serving the user state.
|
|
|
|
func StateGet(ctx *middlewares.AutheliaCtx) {
|
|
|
|
userSession := ctx.GetSession()
|
|
|
|
stateResponse := StateResponse{
|
|
|
|
Username: userSession.Username,
|
|
|
|
AuthenticationLevel: userSession.AuthenticationLevel,
|
|
|
|
DefaultRedirectionURL: ctx.Configuration.DefaultRedirectionURL,
|
|
|
|
}
|
2020-04-22 10:33:14 +07:00
|
|
|
ctx.SetJSONBody(stateResponse) //nolint:errcheck // TODO: Legacy code, consider refactoring time permitting.
|
2019-04-25 04:52:08 +07:00
|
|
|
}
|