Password reset link is not working while user have active session
Describe the bug
After updating Castopod to version 1.6.1, I attempted to send a password reset link to myself via a private browsing window (I was logged into my account before the upgrade). However, I encountered an error when trying to open the link from the email.
Steps to reproduce
- Login in to your admin account in castopod instance
- Update Castopod to 1.6.1
- Check that you still logged in castopod admin panel
- Open new private window in browser and send yourself password reset link from cp-admin
- Open link received in email in main browser window
Expected behavior
No exception
Actual behavior
Page error with exception below
Relevant logs and/or screenshots
CodeIgniter\Shield\Exceptions\LogicException: The user has User Info in Session, so already logged in or in pending login state. If a logged in user logs in again with other account, the session data of the previous user will be used as the new user. Fix your code to prevent users from logging in without logging out or delete the session data. user_id: 1 in /REDACTED/vendor/codeigniter4/shield/src/Authentication/Authenticators/Session.php:655
Stack trace:
#0 /REDACTED/vendor/codeigniter4/shield/src/Authentication/Authenticators/Session.php(760): CodeIgniter\Shield\Authentication\Authenticators\Session->startLogin()
#1 /REDACTED/vendor/codeigniter4/shield/src/Authentication/Authenticators/Session.php(815): CodeIgniter\Shield\Authentication\Authenticators\Session->login()
#2 /REDACTED/vendor/codeigniter4/shield/src/Controllers/MagicLinkController.php(176): CodeIgniter\Shield\Authentication\Authenticators\Session->loginById()
#3 /REDACTED/vendor/codeigniter4/framework/system/CodeIgniter.php(919): CodeIgniter\Shield\Controllers\MagicLinkController->verify()
#4 /REDACTED/vendor/codeigniter4/framework/system/CodeIgniter.php(494): CodeIgniter\CodeIgniter->runController()
#5 /REDACTED/vendor/codeigniter4/framework/system/CodeIgniter.php(353): CodeIgniter\CodeIgniter->handleRequest()
#6 /REDACTED/public/index.php(85): CodeIgniter\CodeIgniter->run()
#7 {main}
Context
- Castopod: 1.6.1
- OS: Ubuntu 22.04.3 LTS
- Browser: Firefox 117.0 (64-bit)
- Web server: Apache 2.4.52-1ubuntu4.6, PHP 8.1.12-1+ubuntu20.04.1+deb.sury.org+1