Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Allow loginflows based on config
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhnchris committed Jul 3, 2023
1 parent 272f3cc commit eb51b1d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions clientapi/routing/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit eb51b1d

Please sign in to comment.