Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Hardaway's avatar

Duoble click login - TokenMismatchException in VerifyCsrfToken.php

Hi, i have a problem with Laravel Auth. When I login first time to my system everything is alright, but if i logout and I try to login with accidentally double click on login button I get error (TokenMismatchException in VerifyCsrfToken.php line 46:) .

0 likes
4 replies
shez1983's avatar

perhaps you could disable the login button after the first click and then re-enable it if there was a problem?

when you login for the first time, what happens if you double clikc the login? i expect you should still get TokenMismatch, logging out & back in is a red herring I think?

rmoiseev's avatar

Or just exclude login form from csrf.

Actually does someone know why protect login form with csrf token? I cant imagine profit of doing csrf atack against login form

Hardaway's avatar

@shez1983 I tried to disabled like this $("#login").one('click', function (event) { $(this).prop('disabled', true); }); Login for the first time it does not matter , one or duoble clicks, everything work fine.

Please or to participate in this conversation.