Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d321b5e

Browse files
hughnsturt2live
andauthored
Refactor login flow types into matrix-js-sdk (#9232)
Co-authored-by: Travis Ralston <[email protected]>
1 parent 56c9546 commit d321b5e

File tree

1 file changed

+8
-40
lines changed

1 file changed

+8
-40
lines changed

src/Login.ts

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,54 +19,22 @@ limitations under the License.
1919
import { createClient } from "matrix-js-sdk/src/matrix";
2020
import { MatrixClient } from "matrix-js-sdk/src/client";
2121
import { logger } from "matrix-js-sdk/src/logger";
22+
import { ILoginParams, LoginFlow } from "matrix-js-sdk/src/@types/auth";
2223

2324
import { IMatrixClientCreds } from "./MatrixClientPeg";
2425
import SecurityCustomisations from "./customisations/Security";
2526

27+
export {
28+
IdentityProviderBrand,
29+
IIdentityProvider,
30+
ISSOFlow,
31+
LoginFlow,
32+
} from "matrix-js-sdk/src/@types/auth";
33+
2634
interface ILoginOptions {
2735
defaultDeviceDisplayName?: string;
2836
}
2937

30-
// TODO: Move this to JS SDK
31-
interface IPasswordFlow {
32-
type: "m.login.password";
33-
}
34-
35-
export enum IdentityProviderBrand {
36-
Gitlab = "gitlab",
37-
Github = "github",
38-
Apple = "apple",
39-
Google = "google",
40-
Facebook = "facebook",
41-
Twitter = "twitter",
42-
}
43-
44-
export interface IIdentityProvider {
45-
id: string;
46-
name: string;
47-
icon?: string;
48-
brand?: IdentityProviderBrand | string;
49-
}
50-
51-
export interface ISSOFlow {
52-
type: "m.login.sso" | "m.login.cas";
53-
// eslint-disable-next-line camelcase
54-
identity_providers?: IIdentityProvider[];
55-
}
56-
57-
export type LoginFlow = ISSOFlow | IPasswordFlow;
58-
59-
// TODO: Move this to JS SDK
60-
/* eslint-disable camelcase */
61-
interface ILoginParams {
62-
identifier?: object;
63-
password?: string;
64-
token?: string;
65-
device_id?: string;
66-
initial_device_display_name?: string;
67-
}
68-
/* eslint-enable camelcase */
69-
7038
export default class Login {
7139
private hsUrl: string;
7240
private isUrl: string;

0 commit comments

Comments
 (0)