You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Call the logout API when we log out
Also try to refactor some of the login/logout code out of MatrixChat and into a separate Lifecycle.js. This still isn't great, but it at least gets some code out of MatrixClient.
This commit is contained in:
@@ -40,6 +40,14 @@ function deviceId() {
|
||||
class MatrixClientPeg {
|
||||
constructor() {
|
||||
this.matrixClient = null;
|
||||
|
||||
// These are the default options used when Lifecycle.js
|
||||
// starts the client. These can be altered when the
|
||||
// 'will_start_client' event is dispatched.
|
||||
this.opts = {
|
||||
pendingEventOrdering: "detached",
|
||||
initialSyncLimit: 20,
|
||||
};
|
||||
}
|
||||
|
||||
get(): MatrixClient {
|
||||
@@ -96,13 +104,13 @@ class MatrixClientPeg {
|
||||
}
|
||||
|
||||
getCredentials() {
|
||||
return [
|
||||
this.matrixClient.baseUrl,
|
||||
this.matrixClient.idBaseUrl,
|
||||
this.matrixClient.credentials.userId,
|
||||
this.matrixClient.getAccessToken(),
|
||||
this.matrixClient.isGuest(),
|
||||
];
|
||||
return {
|
||||
homeserverUrl: this.matrixClient.baseUrl,
|
||||
identityServerUrl: this.matrixClient.idBaseUrl,
|
||||
userId: this.matrixClient.credentials.userId,
|
||||
accessToken: this.matrixClient.getAccessToken(),
|
||||
guest: this.matrixClient.isGuest(),
|
||||
};
|
||||
}
|
||||
|
||||
tryRestore() {
|
||||
|
||||
Reference in New Issue
Block a user