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

feature request: setCaptcha support to pass SetCaptchaOption array #47

Open
joyexpr opened this issue Aug 29, 2022 · 5 comments
Open

feature request: setCaptcha support to pass SetCaptchaOption array #47

joyexpr opened this issue Aug 29, 2022 · 5 comments
Labels
feature request New feature or request todo 🗒️

Comments

@joyexpr
Copy link

joyexpr commented Aug 29, 2022

feature request: setCaptcha support to pass SetCaptchaOption array, for now, only can pass one SetCaptchaOption

for example, I want generate a captcha: "abcd", and "ab" is red, "cd" is green

@Shashank3736
Copy link
Owner

Can you elaborate on the request? Like what you actually want, a feature to customise each character of a captcha.

@joyexpr
Copy link
Author

joyexpr commented Sep 1, 2022

if so, I can let user to enter the specified character, for example:

  1. please enter the red characters
  2. please enter the biggest 2 characters
    many many possibilities

@Shashank3736
Copy link
Owner

Hmm... make sense I will try to add this feature

@Shashank3736 Shashank3736 added feature request New feature or request todo 🗒️ labels Sep 3, 2022
@joyexpr
Copy link
Author

joyexpr commented Sep 3, 2022

by the way, is it a bug in captcha.ts:

if (option.colors && option.colors?.length > 2) {this._ctx.fillStyle = option.colors[getRandom(option.colors.length - 1)];}

should it be:

if (option.colors && option.colors?.length >= 2)  

Shashank3736 added a commit that referenced this issue Jan 2, 2023
Bug solved as per reported in issue #47
@Shashank3736
Copy link
Owner

Shashank3736 commented Jan 10, 2023

by the way, is it a bug in captcha.ts:

if (option.colors && option.colors?.length > 2) {this._ctx.fillStyle = option.colors[getRandom(option.colors.length - 1)];}

should it be:

if (option.colors && option.colors?.length >= 2)  

Yupp it is a bug. Actually I never use option.colors so I never noticed it. Thank you for raising it 😅

@Shashank3736 Shashank3736 added the bug Something isn't working label Jan 10, 2023
@Shashank3736 Shashank3736 removed the bug Something isn't working label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request todo 🗒️
Projects
None yet
Development

No branches or pull requests

2 participants