mitydigital / statamic-two-factor

A Two Factor authentication addon for Statamic
Other
2 stars 2 forks source link

After pushing to our dev server we are getting an error #14

Closed Oleafeon closed 4 months ago

Oleafeon commented 4 months ago

I had the plugin working on my local machine everything worked fine but when i uploaded the website to our dev server i got the following error after logging in Screenshot 2024-06-20 at 09 24 04 (3)

martyf commented 4 months ago

Locally, and on your server, what is the output of:

php artisan route:list --path=cp/auth/

Definitely a weird one though. Be interesting to see if you have steps to replicate it.

Oleafeon commented 4 months ago

Local GET|HEAD cp/auth/extend statamic.cp.extend › Statamic\Http › ExtendSessio… GET|HEAD cp/auth/login statamic.cp.login › Statamic\Http › LoginControlle… POST cp/auth/login statamic.cp. › Statamic\Http › LoginController@log… GET|HEAD cp/auth/logout statamic.cp.logout › Statamic\Http › LoginControl… POST cp/auth/password/email statamic.cp.password.email › Statamic\Htt… GET|HEAD cp/auth/password/reset statamic.cp.password.request › Statamic\H… POST cp/auth/password/reset statamic.cp.password.reset.action › Stata… GET|HEAD cp/auth/password/reset/{token} statamic.cp.password.reset › Stat… GET|HEAD cp/auth/stop-impersonating statamic.cp.impersonation.stop › Stat… GET|HEAD cp/auth/token statamic.cp.token › Statamic\Http › CsrfTokenContr… GET|HEAD cp/auth/two-factor/challenge statamic.cp.statamic-two-factor.cha… POST cp/auth/two-factor/challenge statamic.cp.statamic-two-factor.cha… POST cp/auth/two-factor/complete statamic.cp.statamic-two-factor.comp… GET|HEAD cp/auth/two-factor/locked statamic.cp.statamic-two-factor.locked… GET|HEAD cp/auth/two-factor/setup statamic.cp.statamic-two-factor.setup … POST cp/auth/two-factor/setup statamic.cp.statamic-two-factor.confirm… GET|HEAD cp/auth/unauthorized statamic.cp.unauthorized › Statamic\Http › …

Server: Your application doesn't have any routes matching the given criteria.

martyf commented 4 months ago

There's something bigger than just Two Factor going on here - that command should at least output:

  GET|HEAD   cp/auth/extend ............................................ statamic.cp.extend › Statamic\Http › ExtendSessionController
  GET|HEAD   cp/auth/login ........................................ statamic.cp.login › Statamic\Http › LoginController@showLoginForm
  POST       cp/auth/login ..................................................... statamic.cp. › Statamic\Http › LoginController@login
  GET|HEAD   cp/auth/logout ............................................. statamic.cp.logout › Statamic\Http › LoginController@logout
  POST       cp/auth/password/email ........ statamic.cp.password.email › Statamic\Http › ForgotPasswordController@sendResetLinkEmail
  GET|HEAD   cp/auth/password/reset ..... statamic.cp.password.request › Statamic\Http › ForgotPasswordController@showLinkRequestForm
  POST       cp/auth/password/reset ............... statamic.cp.password.reset.action › Statamic\Http › ResetPasswordController@reset
  GET|HEAD   cp/auth/password/reset/{token} ...... statamic.cp.password.reset › Statamic\Http › ResetPasswordController@showResetForm
  GET|HEAD   cp/auth/stop-impersonating ............... statamic.cp.impersonation.stop › Statamic\Http › ImpersonationController@stop
  GET|HEAD   cp/auth/token .................................................. statamic.cp.token › Statamic\Http › CsrfTokenController
  GET|HEAD   cp/auth/unauthorized ................................. statamic.cp.unauthorized › Statamic\Http › UnauthorizedController

These are all core Statamic routes - and these aren't appearing on your server so there's something else going on.

Can you confirm that the CP is enabled on your server? You may need to check config/statamic/cp.php' and ensureenabledis true - which may also need you to checkCP_ENABLEDin your.env` file.

If I set CP_ENABLED to false on my local version, I can replicate the issue, and get no routes returned with the message you stated above.

Oleafeon commented 4 months ago

thats weird if i turn off two factor i can get into the cp so cp is enabled

martyf commented 4 months ago

I need details on how to replicate this issue to be able to help.

We've used the addon many times ourselves and have not experienced an issue like this.

Can you please organise a repo and step-by-step instructions to replicate this?

I don't believe there is an issue with the addon itself, but potentially your hosting setup - especially given you had it running on your local dev environment too.

Oleafeon commented 4 months ago

I have solved the problem, after i cleared the route the error disapeared