ryancramerdesign / LoginRegister

ProcessWire 3.x module for rendering and processing login, user registration, and profile edits.
24 stars 8 forks source link

This request was aborted because it appears to be forged #1

Closed matjazpotocnik closed 7 years ago

matjazpotocnik commented 7 years ago

Hi, Ryan !

I was playing with this module on the demo site and got this error. I admit that I abused the login form (resubmiting, going back, login/logout in multiple tabs) and I'm familiar with this error, but frontend users would be confused ...

Error: Exception: This request was aborted because it appears to be forged. (in /home/www/demopro/regular/wire/core/SessionCSRF.php line 190)

0 /home/www/demopro/regular/site/modules/LoginRegister/LoginRegister.module(594): ProcessWire\SessionCSRF->validate()

1 /home/www/demopro/regular/wire/core/Wire.php(383): ProcessWire\LoginRegister->___processRegisterForm(Object(ProcessWire\InputfieldForm))

2 /home/www/demopro/regular/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___processRegis...', Array)

3 /home/www/demopro/regular/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\LoginRegister), 'processRegister...', Array)

4 /home/www/demopro/regular/site/modules/LoginRegister/LoginRegister.module(295): ProcessWire\Wire->__call('processRegister...', Array)

5 /home/www/demopro/regular/wire/core/Wire.php(380): ProcessWire\LoginRegister->___execute()

6 /home/www/demopro/regular/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___execute', Array)

7 /home/www/demopro

This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged.

ryancramerdesign commented 7 years ago

The site is in debug mode, so it's doing what it should. If it weren't in debug mode, it would show a 500 error. If you prefer, you can wrap the module execute() call in a try/catch to provide your own error handler too.

On Fri, Sep 22, 2017 at 3:09 PM, Matjaž Potočnik notifications@github.com wrote:

Hi, Ryan !

I was playing with this module on the demo site and got this error. I admit that I abused the login form (resubmiting, going back, login/logout in multiple tabs) and I'm familiar with this error, but frontend users would be confused ...

Error: Exception: This request was aborted because it appears to be forged. (in /home/www/demopro/regular/wire/core/SessionCSRF.php line 190)

0 /home/www/demopro/regular/site/modules/LoginRegister/LoginRegister.module(594):

ProcessWire\SessionCSRF->validate()

1 https://github.com/ryancramerdesign/LoginRegister/issues/1

/home/www/demopro/regular/wire/core/Wire.php(383): ProcessWire\LoginRegister->___processRegisterForm(Object( ProcessWire\InputfieldForm))

2 /home/www/demopro/regular/wire/core/WireHooks.php(698):

ProcessWire\Wire->_callMethod('___processRegis...', Array)

3 /home/www/demopro/regular/wire/core/Wire.php(442):

ProcessWire\WireHooks->runHooks(Object(ProcessWire\LoginRegister), 'processRegister...', Array)

4 /home/www/demopro/regular/site/modules/LoginRegister/LoginRegister.module(295):

ProcessWire\Wire->__call('processRegister...', Array)

5 /home/www/demopro/regular/wire/core/Wire.php(380):

ProcessWire\LoginRegister->___execute()

6 /home/www/demopro/regular/wire/core/WireHooks.php(698):

ProcessWire\Wire->_callMethod('___execute', Array)

7 /home/www/demopro

This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ryancramerdesign/LoginRegister/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUCUAeQirVmmRCN4HisOirL9680oLBXks5slAXvgaJpZM4PhHkq .

matjazpotocnik commented 7 years ago

Try/catch is just fine. Thanks for info.

ryancramerdesign commented 7 years ago

No problem, thanks for the testing.

On Fri, Sep 22, 2017 at 3:14 PM, Matjaž Potočnik notifications@github.com wrote:

Closed #1 https://github.com/ryancramerdesign/LoginRegister/issues/1.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ryancramerdesign/LoginRegister/issues/1#event-1261816985, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUCUFL2Gyo8_fnKmeM-lZj60Y_ddLqcks5slAcUgaJpZM4PhHkq .

somatonic commented 6 years ago

This is not a solution at all. It should be handled by the module not in the code of the the template/implementation.