From: Dessalines Date: Thu, 2 Jul 2020 01:48:29 +0000 (-0400) Subject: Adding a math check for logins (until we get a proper captcha). X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/nerdica.net/static/%7Bpost.url%7D?a=commitdiff_plain;h=d22152eefd408da84973ef0bffec6ee1d0234bc8;p=lemmy.git Adding a math check for logins (until we get a proper captcha). --- diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx index ce04d0d4..97899345 100644 --- a/ui/src/components/login.tsx +++ b/ui/src/components/login.tsx @@ -20,6 +20,11 @@ interface State { loginLoading: boolean; registerLoading: boolean; enable_nsfw: boolean; + mathQuestion: { + a: number; + b: number; + answer: number; + }; } export class Login extends Component { @@ -40,6 +45,11 @@ export class Login extends Component { loginLoading: false, registerLoading: false, enable_nsfw: undefined, + mathQuestion: { + a: Math.floor(Math.random() * 10) + 1, + b: Math.floor(Math.random() * 10) + 1, + answer: undefined, + }, }; constructor(props: any, context: any) { @@ -215,6 +225,23 @@ export class Login extends Component { /> +
+ + +
+ +
+
{this.state.enable_nsfw && (
@@ -235,7 +262,11 @@ export class Login extends Component { )}
-