cootook / project

Learn by doing project for everybody
MIT License
0 stars 0 forks source link

[TICKET] - add reCAPTCHA to login view #20

Closed cootook closed 1 month ago

cootook commented 10 months ago

Short Summary:

There is reCAPTCHA checkbox (challenge) on signup page. It protects the app from automated registration of new users. We also need reCAPTCHA on login page. Along with adding reCAPTCHA on the page declaring a new environment variable should be done.

image

Stake Holders:

@cootook

Impact/Urgency:

middle priority, no impact on app's logic, docs should be updated because of new environment variable

Full Description:

reCAPTCHA protects the website from fraud and abuse. We use automatically rendered the reCAPTCHA widget. reCaptcha requires using of two keys:

Using JS we should disable **singin** button is reCAPTCHA not passed
```javascript
    function set_is_recaptcha_false() {
        is_recaptcha = false;
        validate_pass()
    }

    function set_is_recaptcha_true() {
        is_recaptcha = true;
        validate_pass()
    }

HTML attributes that call these functions: data-callback="set_is_recaptcha_true" data-expired-callback="set_is_recaptcha_false"

Test Cases:

route "/signin/" with dev tools in browser enable submit button and try without passing reCAPTCHA

Resources:

Flask context-processors reCAPTCHA v2

cootook commented 1 month ago

commits for this ticket https://github.com/cootook/project/commit/9a1a7c820f8b3de45d21f0ed403e0716e1e531c0 https://github.com/cootook/project/commit/4200287988cf9d588eb9a01d16940d13318bdf16