mitydigital / statamic-two-factor

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

500 Server Error #20

Open thetemplateblog opened 10 hours ago

thetemplateblog commented 10 hours ago

I had this working locally just fine but when I deployed to the main site with ploi and am getting a 500 after I enter the code.

Any ideas? EDIT: I wonder if it has to do with setting up the code locally and then using the same user file when it was pushed live.

domain.com/cp/auth/two-factor/challenge is the page with the 500

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

  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/two-factor/challenge ....................................................................................................................................................................................................... statamic.cp.statamic-two-factor.challenge › MityDigital\StatamicTwoFactor › TwoFactorChallengeController@index
  POST       cp/auth/two-factor/challenge ............................................................................................................................................................................................... statamic.cp.statamic-two-factor.challenge.attempt › MityDigital\StatamicTwoFactor › TwoFactorChallengeController@store
  POST       cp/auth/two-factor/complete .......................................................................................................................................................................................................... statamic.cp.statamic-two-factor.complete › MityDigital\StatamicTwoFactor › TwoFactorSetupController@complete
  GET|HEAD   cp/auth/two-factor/locked ..................................................................................................................................................................................................................... statamic.cp.statamic-two-factor.locked › MityDigital\StatamicTwoFactor › LockedUserController@index
  GET|HEAD   cp/auth/two-factor/setup ................................................................................................................................................................................................................... statamic.cp.statamic-two-factor.setup › MityDigital\StatamicTwoFactor › TwoFactorSetupController@index
  POST       cp/auth/two-factor/setup ................................................................................................................................................................................................................. statamic.cp.statamic-two-factor.confirm › MityDigital\StatamicTwoFactor › TwoFactorSetupController@store
  GET|HEAD   cp/auth/unauthorized ............................................................................................................................................................................................................................................................ statamic.cp.unauthorized › Statamic\Http › UnauthorizedController

The deploy script is:

git reset --hard origin/main
git pull origin main
composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev
echo "" | sudo -S service php8.3-fpm reload

rm -rf node_modules
npm install
npm run build

echo "🚀 Application deployed!"

php artisan cache:clear
php artisan config:cache
php artisan route:cache
php artisan statamic:stache:warm
php artisan statamic:search:update --all
php artisan statamic:static:clear
php artisan statamic:assets:generate-presets
thetemplateblog commented 9 hours ago

Ahhh, This is because I used the same user from the local site. I wonder if there is a way to handle that more better?

martyf commented 1 hour ago

What was the error you were getting?

Without knowing that I'm not sure what I'm meant to be trying to handle.

You are able to use the same user locally and in production. Check out this page in the docs for further details.