Store homeserver URL from .well-known responses
This commit is contained in:
parent
2cff2cdc22
commit
9dcf3bdb12
@ -163,6 +163,7 @@ func (c *Container) PasswordLogin(user, password string) error {
|
|||||||
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()
|
||||||
@ -219,6 +223,7 @@ func (c *Container) SingleSignOn() error {
|
|||||||
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