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

Displaying undefined on 4 characters #43

Closed
AshuInsideOut opened this issue Jul 19, 2022 · 8 comments
Closed

Displaying undefined on 4 characters #43

AshuInsideOut opened this issue Jul 19, 2022 · 8 comments
Labels

Comments

@AshuInsideOut
Copy link

I tried to set the characters limit to 4 but it displays those 4 characters but also says undefined at the end.

const captcha = new Captcha(100, 100);
captcha.addDecoy().drawTrace().drawCaptcha({ characters: 4 });

image

@Shashank3736
Copy link
Owner

Which version of captcha-canvas you are using right now?

@AshuInsideOut
Copy link
Author

Version: 3.1.0

@Shashank3736
Copy link
Owner

ok, issue is confirmed I will try to solve it today thank you for reporting this. For the time you can use CaptchaGenerator

@Shashank3736 Shashank3736 added bug Something isn't working Priority: High labels Aug 7, 2022
@AshuInsideOut
Copy link
Author

Okay, for the time being, I will use 6 characters and wait for the bug to be fixed. :)

@Shashank3736
Copy link
Owner

Shashank3736 commented Aug 7, 2022

To solve this problem you have to use drawCaptcha before addDecoy and drawTrace. So,

// wrong
const captcha = new Captcha(100, 100);
captcha.addDecoy().drawTrace().drawCaptcha({ characters: 4 });
// right
const captcha = new Captcha(100, 100);
captcha.drawCaptcha({ characters: 4 }).addDecoy().drawTrace();

Try this and let me know if you are still facing any problems.

@Shashank3736
Copy link
Owner

New release v3.1.1 will solve your issue.

const captcha = new Captcha(100, 100, 4);
captcha.addDecoy().drawTrace().drawCaptcha();

This will create a captcha with 4 characters and also you can draw a captcha above the decoy and trace line.

@Shashank3736 Shashank3736 added bug fix and removed bug Something isn't working Priority: High labels Aug 9, 2022
@AshuInsideOut
Copy link
Author

AshuInsideOut commented Aug 9, 2022 via email

@Shashank3736
Copy link
Owner

Let me know if your issue is resolved or not. If it is resolved then please close the issue

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

No branches or pull requests

2 participants