From af1e8868bd13df441ea02f9c13f5c3ee359db597 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 17 Feb 2023 14:18:40 -0500 Subject: [PATCH] Adding 2FA support. Fixes #938 --- lemmy-translations | 2 +- package.json | 2 +- src/shared/components/home/login.tsx | 45 +++++++++++++- src/shared/components/person/settings.tsx | 71 +++++++++++++++++++++++ src/shared/utils.ts | 1 + yarn.lock | 8 +-- 6 files changed, 120 insertions(+), 9 deletions(-) diff --git a/lemmy-translations b/lemmy-translations index 819531ae..1c42c579 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 819531ae64c6cba12cb406eb98333fd52988bf3e +Subproject commit 1c42c579460871de7b4ea18e58dc25543b80d289 diff --git a/package.json b/package.json index ab6f8007..0b9afe02 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "inferno-server": "^8.0.5", "isomorphic-cookie": "^1.2.4", "jwt-decode": "^3.1.2", - "lemmy-js-client": "0.17.2-rc.1", + "lemmy-js-client": "0.17.2-rc.2", "markdown-it": "^13.0.1", "markdown-it-container": "^3.0.0", "markdown-it-footnote": "^3.0.3", diff --git a/src/shared/components/home/login.tsx b/src/shared/components/home/login.tsx index 7cdde927..44da9b8f 100644 --- a/src/shared/components/home/login.tsx +++ b/src/shared/components/home/login.tsx @@ -26,8 +26,10 @@ interface State { form: { username_or_email?: string; password?: string; + totp_token?: string; }; loginLoading: boolean; + showTotp: boolean; siteRes: GetSiteResponse; } @@ -38,6 +40,7 @@ export class Login extends Component { state: State = { form: {}, loginLoading: false, + showTotp: false, siteRes: this.isoData.site_res, }; @@ -141,6 +144,28 @@ export class Login extends Component { + {this.state.showTotp && ( +
+ +
+ +
+
+ )}
+ {this.totpSection()}