diff --git a/app/definitions/ICredentials.ts b/app/definitions/ICredentials.ts new file mode 100644 index 000000000..072b8470e --- /dev/null +++ b/app/definitions/ICredentials.ts @@ -0,0 +1,15 @@ +export interface ICredentials { + user?: string; + password?: string; + username?: string; + ldapPass?: string; + ldap?: boolean; + ldapOptions?: object; + crowdPassword?: string; + crowd?: boolean; + code?: string; + totp?: { + login: ICredentials; + code: string; + }; +} diff --git a/app/definitions/index.ts b/app/definitions/index.ts index c11e91b1a..621300b94 100644 --- a/app/definitions/index.ts +++ b/app/definitions/index.ts @@ -24,6 +24,7 @@ export * from './IServerHistory'; export * from './IRocketChat'; export * from './ICertificate'; export * from './IUrl'; +export * from './ICredentials'; export interface IBaseScreen, S extends string> { navigation: StackNavigationProp; diff --git a/app/lib/rocketchat/services/connect.ts b/app/lib/rocketchat/services/connect.ts index bf9aeca1b..1a2af2f87 100644 --- a/app/lib/rocketchat/services/connect.ts +++ b/app/lib/rocketchat/services/connect.ts @@ -10,23 +10,7 @@ import { loginRequest, setUser } from '../../../actions/login'; import sdk from './sdk'; import I18n from '../../../i18n'; import { MIN_ROCKETCHAT_VERSION } from '../rocketchat'; -import { ILoggedUser } from '../../../definitions'; - -interface ICredentials { - user?: string; - password?: string; - username?: string; - ldapPass?: string; - ldap?: boolean; - ldapOptions?: object; - crowdPassword?: string; - crowd?: boolean; - code?: string; - totp?: { - login: ICredentials; - code: string; - }; -} +import { ICredentials, ILoggedUser } from '../../../definitions'; async function login(credentials: ICredentials, isFromWebView = false) { // RC 0.64.0