Commit fc47f7cd83
Unsigned
Layout: unified · split
README.md +2 −2
| @@ -154,8 +154,8 @@ _(replace the placeholders in brackets [] with your own details)_: | ||
| 154 | 154 | /set matrix-rust.server.[server-name].username [username] |
| 155 | 155 | /set matrix-rust.server.[server-name].password [password] |
| 156 | 156 | |
| 157 | To use single sign-on instead of password login, leave the password empty. | |
| 158 | WeeChat will print a login URL when you connect. | |
| 157 | If the homeserver advertises single sign-on, leave the password empty to use | |
| 158 | it. WeeChat will print a login URL when you connect. | |
| 159 | 159 | |
| 160 | 160 | 3. Now try to connect. The first connection can take a few minutes while the |
| 161 | 161 | client syncs the account: |
src/connection.rs +4 −3
| @@ -423,14 +423,15 @@ impl Connection { | ||
| 423 | 423 | return; |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | let sso_channel = channel.clone(); | |
| 426 | let url_sender = channel.clone(); | |
| 427 | 427 | let mut builder = matrix_auth |
| 428 | 428 | .login_sso(move |sso_url| { |
| 429 | let sso_channel = sso_channel.clone(); | |
| 430 | 429 | async move { |
| 431 | let _ = sso_channel | |
| 430 | let _ = url_sender | |
| 432 | 431 | .send(Ok(ClientMessage::SsoLoginUrl(sso_url))) |
| 433 | 432 | .await; |
| 433 | // Handing the URL to WeeChat successfully completes | |
| 434 | // our callback; returning an error would abort SSO. | |
| 434 | 435 | Ok(()) |
| 435 | 436 | } |
| 436 | 437 | }) |