mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53: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,
|
||||
) util.JSONResponse {
|
||||
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
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusOK,
|
||||
JSON: flows{
|
||||
Flows: []flow{
|
||||
{Type: authtypes.LoginTypePassword},
|
||||
{Type: authtypes.LoginTypeApplicationService},
|
||||
},
|
||||
Flows: loginFlows,
|
||||
},
|
||||
}
|
||||
} else if req.Method == http.MethodPost {
|
||||
|
|
|
|||
Loading…
Reference in a new issue