Store homeserver URL from .well-known responses
This commit is contained in:
parent
2cff2cdc22
commit
9dcf3bdb12
@ -162,7 +162,8 @@ func (c *Container) PasswordLogin(user, password string) error {
|
|||||||
Password: password,
|
Password: password,
|
||||||
InitialDeviceDisplayName: "gomuks",
|
InitialDeviceDisplayName: "gomuks",
|
||||||
|
|
||||||
StoreCredentials: true,
|
StoreCredentials: true,
|
||||||
|
StoreHomeserverURL: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -175,6 +176,9 @@ func (c *Container) finishLogin(resp *mautrix.RespLogin) {
|
|||||||
c.config.UserID = resp.UserID
|
c.config.UserID = resp.UserID
|
||||||
c.config.DeviceID = resp.DeviceID
|
c.config.DeviceID = resp.DeviceID
|
||||||
c.config.AccessToken = resp.AccessToken
|
c.config.AccessToken = resp.AccessToken
|
||||||
|
if resp.WellKnown != nil && len(resp.WellKnown.Homeserver.BaseURL) > 0 {
|
||||||
|
c.config.HS = resp.WellKnown.Homeserver.BaseURL
|
||||||
|
}
|
||||||
c.config.Save()
|
c.config.Save()
|
||||||
|
|
||||||
go c.Start()
|
go c.Start()
|
||||||
@ -218,7 +222,8 @@ func (c *Container) SingleSignOn() error {
|
|||||||
Token: loginToken,
|
Token: loginToken,
|
||||||
InitialDeviceDisplayName: "gomuks",
|
InitialDeviceDisplayName: "gomuks",
|
||||||
|
|
||||||
StoreCredentials: true,
|
StoreCredentials: true,
|
||||||
|
StoreHomeserverURL: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
respondHTML(w, http.StatusForbidden, err.Error())
|
respondHTML(w, http.StatusForbidden, err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user