captcha icon indicating copy to clipboard operation
captcha copied to clipboard

Cannot return error message if verification fails

Open Wayne1316 opened this issue 4 years ago • 1 comments

version laravel 7.12.0

I added a verification code to login But after the verification fails, the URL redirected to the verification code picture.

The reason it happened is that the url of the picture is not a static file So if your page link to the url, It will be written to the session._previous When Laravel handle ValidationException will redirect session._previous url

Wayne1316 avatar Jun 02 '20 09:06 Wayne1316

In case it helps anyone else I faced the same issue with Laravel 8 but managed to get around it by replacing the {!! captcha_img() !!} in my blade template with <img src="data:image/png;base64,{!! base64_encode(captcha()->getContent()) !!}">

This outputs the image content directly without requesting it from the /captcha endpoint and therefore doesn't replace the previous session URL..

richbkuk avatar Jun 16 '21 11:06 richbkuk