Only use SSO if no password is entered

This commit is contained in:
Tulir Asokan 2021-02-18 18:35:53 +02:00
parent 3a2a11b2b0
commit d820c56e8b

View File

@ -254,7 +254,7 @@ func (c *Container) Login(user, password string) error {
for _, flow := range resp.Flows { for _, flow := range resp.Flows {
if flow.Type == "m.login.password" { if flow.Type == "m.login.password" {
return c.PasswordLogin(user, password) return c.PasswordLogin(user, password)
} else if flow.Type == "m.login.sso" { } else if flow.Type == "m.login.sso" && len(password) == 0 {
return c.SingleSignOn() return c.SingleSignOn()
} }
} }