Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Cloudflare Challenge page #395

Merged

Conversation

tanchekwei
Copy link
Contributor

Enable YouChat by default because found that it actually allows anonymous access.


Then I do some testing, and found that Pi and YouChat hit 403 error:
image

The error is caused by Cloudflare Turnstile, requires users to solve a CAPTCHA before accessing the website.
So I updated the getSSEDisplayError function to prompt users to solve the CAPTCHA.
To display this error only for Pi and YouChat, I added the _isUseCloudflareTurnstile = true static variable.
image


I also modified the error text style to enable word wrap, to prevent horizontal scroll when the text is too long.
image

@vercel
Copy link

vercel bot commented Jul 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chatall ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2023 11:22am

@tanchekwei tanchekwei changed the title Enable YouChat default and handle 403 error Enable YouChat by default and handle 403 error Jul 13, 2023
Copy link
Member

@sunner sunner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you bro. I cherry-picked the first and second commits and leave some comments on the last one.

It looks that solving captcha will be more popular. So a general solution is very useful.

The Bing Chat has a specific solution: https://github.com/sunner/ChatALL/blob/f3e39c2d4854629f3359ff628589d21286d49378/src/bots/microsoft/BingChatBot.js#L195-L203

Yours is closer to be general. Could you take a step forward? Thank you.

src/bots/Bot.js Outdated Show resolved Hide resolved
src/bots/Bot.js Outdated Show resolved Hide resolved
@sunner sunner changed the title Enable YouChat by default and handle 403 error Handle captcha Jul 13, 2023
@tanchekwei tanchekwei force-pushed the set-youchat-default-and-handle-403-error branch from dd5a601 to d04f549 Compare July 14, 2023 11:06
@tanchekwei tanchekwei force-pushed the set-youchat-default-and-handle-403-error branch from d04f549 to 614972b Compare July 14, 2023 11:08
@tanchekwei tanchekwei changed the title Handle captcha Handle Cloudflare Challenge page Jul 14, 2023
@tanchekwei tanchekwei force-pushed the set-youchat-default-and-handle-403-error branch from 614972b to 88cc99e Compare July 14, 2023 11:22
@sunner sunner merged commit 9b70aa5 into ai-shifu:main Jul 14, 2023
@tanchekwei
Copy link
Contributor Author

You are right on this, Pi returns 403 to force login.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants