1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Add method to fetch /account/whoami (#2046)

This commit is contained in:
Michael Telatynski
2021-12-02 13:43:15 +00:00
committed by GitHub
parent 87b920698f
commit b716cde9b5

View File

@@ -8892,6 +8892,13 @@ export class MatrixClient extends EventEmitter {
room.addThreadedEvent(event);
});
}
/**
* Fetches the user_id of the configured access token.
*/
public async whoami(): Promise<{ user_id: string }> { // eslint-disable-line camelcase
return this.http.authedRequest(undefined, "GET", "/account/whoami");
}
}
/**