mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 15:03:09 -06:00
Allow loginflows based on config
This commit is contained in:
parent
272f3cc2cc
commit
eb51b1d24e
|
|
@ -47,14 +47,16 @@ func Login(
|
||||||
cfg *config.ClientAPI,
|
cfg *config.ClientAPI,
|
||||||
) util.JSONResponse {
|
) util.JSONResponse {
|
||||||
if req.Method == http.MethodGet {
|
if req.Method == http.MethodGet {
|
||||||
|
var loginFlows []flow
|
||||||
|
loginFlows = []flow{{Type: authtypes.LoginTypePassword}}
|
||||||
|
if len(cfg.Derived.ApplicationServices) == 0 {
|
||||||
|
loginFlows = append(loginFlows, flow{Type: authtypes.LoginTypeApplicationService})
|
||||||
|
}
|
||||||
// TODO: support other forms of login, depending on config options
|
// TODO: support other forms of login, depending on config options
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusOK,
|
Code: http.StatusOK,
|
||||||
JSON: flows{
|
JSON: flows{
|
||||||
Flows: []flow{
|
Flows: loginFlows,
|
||||||
{Type: authtypes.LoginTypePassword},
|
|
||||||
{Type: authtypes.LoginTypeApplicationService},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
} else if req.Method == http.MethodPost {
|
} else if req.Method == http.MethodPost {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue