diff --git a/package.json b/package.json index f572c33..c1fd321 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lemmy-js-client", - "version": "0.17.2-rc.1", + "version": "0.17.2-rc.3", "description": "A javascript / typescript client for Lemmy", "repository": "https://github.com/LemmyNet/lemmy-js-client", "license": "AGPL-3.0", diff --git a/src/interfaces/api/person.ts b/src/interfaces/api/person.ts index 81dfc69..7210955 100644 --- a/src/interfaces/api/person.ts +++ b/src/interfaces/api/person.ts @@ -13,6 +13,10 @@ import { export interface Login { username_or_email: string; password: string; + /** + * If your user has 2fa set up, they must provide the token, otherwise you will receive the error "missing_totp_token" + */ + totp_2fa_token?: string; } /** @@ -103,6 +107,15 @@ export interface SaveUserSettings { show_read_posts?: boolean; show_new_post_notifs?: boolean; discussion_languages?: number[]; + /** + * If this is set to true, lemmy will generate or regenerate a 2-factor (totp) authentication secret. + * You can then use the `totp_2fa_url` from [[LocalUserSettings]] to set up your authenticator app. + * + * If this is set to false, it will remove 2-factor for your account. + * + * If this is undefined, it leaves your 2-factor setup as is. + */ + generate_totp_2fa?: boolean; auth: string; } diff --git a/src/interfaces/source.ts b/src/interfaces/source.ts index 404b348..97a1ba4 100644 --- a/src/interfaces/source.ts +++ b/src/interfaces/source.ts @@ -16,6 +16,10 @@ export interface LocalUserSettings { show_new_post_notifs: boolean; email_verified: boolean; accepted_application: boolean; + /** + * An installation url for your 2-factor authenticator app. + */ + totp_2fa_url?: string; } export interface PersonSafe {