Skip to content

Commit

Permalink
Improve types to match reality (#3510)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Jun 28, 2023
1 parent acbcb46 commit de64779
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/@types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export interface IAddThreePidOnlyBody {
export interface IBindThreePidBody {
client_secret: string;
id_server: string;
id_access_token: string;
// Some older identity servers have no auth enabled
id_access_token: string | null;
sid: string;
}

Expand Down
5 changes: 3 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9097,6 +9097,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
* @param msisdnToken - The MSISDN token, as enetered by the user.
* @param identityAccessToken - The `access_token` field of the Identity
* Server `/account/register` response (see {@link registerWithIdentityServer}).
* Some legacy identity servers had no authentication here.
*
* @returns Promise which resolves: Object, containing success boolean.
* @returns Rejects: with an error response.
Expand All @@ -9106,7 +9107,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
sid: string,
clientSecret: string,
msisdnToken: string,
identityAccessToken: string,
identityAccessToken: string | null,
): Promise<{ success: boolean }> {
const params = {
sid: sid,
Expand All @@ -9119,7 +9120,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
"/validate/msisdn/submitToken",
params,
IdentityPrefix.V2,
identityAccessToken,
identityAccessToken ?? undefined,
);
}

Expand Down

0 comments on commit de64779

Please sign in to comment.