Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

911 signin captcha

Open notmd opened this issue 2 years ago • 11 comments

Part of #911

  • Add Cloudflare captcha.

notmd avatar Jan 25 '23 18:01 notmd

There is a small problem when the user fills in the email and clicks the sign-in button too fast, the captcha may not be loaded yet (it can take 2s depending on the internet connection). And the website will inform the captcha is invalid which may confuse the users because they don't see any captcha on the page. Here are a few solutions.

  • Disable the button until the onSuccess callback gets called. But maybe there is a situation that the captcha never gets successful, and the user won't be able to log in.
  • Check for the captcha response when the user clicks login and shows a toast.
  • Switch to visible captcha.

notmd avatar Jan 27 '23 17:01 notmd

maybe I'm just overlooking this right now, but is it possible that we have a setting to circumvent (i.e. disable) the captcha, maybe via an environment variable?

yk avatar Jan 28 '23 10:01 yk

maybe I'm just overlooking this right now, but is it possible that we have a setting to circumvent (i.e. disable) the captcha, maybe via an environment variable?

Sure, I will try to add it now.

notmd avatar Jan 28 '23 15:01 notmd

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar Jan 29 '23 16:01 github-actions[bot]

:x: pre-commit failed. Please run pre-commit run --all-files locally and commit the changes. Find more information in the repository's CONTRIBUTING.md

github-actions[bot] avatar Jan 29 '23 16:01 github-actions[bot]

I have no idea why the tests only fail in CI, in local they still passing.

notmd avatar Jan 29 '23 19:01 notmd

Let me copy your branch and see if i can replicate this test failure. The fact that everything fails is worrisome

fozziethebeat avatar Jan 31 '23 07:01 fozziethebeat

The web changes look good to me. Does the local docker compose stack still work fine using these fake captcha credentials?

Yes, it still works.

Let me copy your branch and see if i can replicate this test failure. The fact that everything fails is worrisome

All the tests failed because can't log in, which probably related to my changes

notmd avatar Jan 31 '23 08:01 notmd

@fozziethebeat I managed to reproduce the test fails in the local by running a full build (docker compose up). Will try to fix the tests tonight.

notmd avatar Jan 31 '23 09:01 notmd

@fozziethebeat I have no idea to fix the tests so I disable the captcha for now, lol. If you have time, please help me out.

notmd avatar Jan 31 '23 13:01 notmd

@yk can you do a final review of the non-web changes? They seem to address your request of an env variable to disable the captcha

fozziethebeat avatar Jan 31 '23 13:01 fozziethebeat

Merging!

@notmd can you share in discord what env variables we have to setup on the deployment instances? If you can generate them and send them to me privately I can add them to Github secrets

fozziethebeat avatar Feb 01 '23 06:02 fozziethebeat