fanningert / webtrees_simpleautologin

This module provides a simple way to add a SSO auto login for webtrees in combination with a authentication proxy (like oauth2-proxy).
GNU Affero General Public License v3.0
9 stars 0 forks source link

Class 'Fisharebest\Webtrees\Carbon' not found #3

Closed Neriderc closed 8 months ago

Neriderc commented 2 years ago

I'm trying to set this up with webtrees and have come across this error when logging in: Class 'Fisharebest\Webtrees\Carbon' not found …/modules_v4/webtrees_simpleautologin/src/Modules/SimpleAutoLoginPage.php:79

I'm using webtrees 2.1.2 and I know there have been some changes so it might not support the recent versions. Any chance of an update?

Neriderc commented 2 years ago

Quick update: I edited the file "src/Modules/SimpleAutoLoginPage.php" and changed "Fisharebest\Webtrees\Carbon" to "Carbon/Carbon" after seeing this is how it's now used in the webtrees code. I have no idea what it was supposed to do, but I no longer get the error, and the login seems to work :)

4heaton commented 2 years ago

I found I was running into this error as well running webtrees 2.1.7. However, I did not have any luck with the change that worked for @Neriderc.

Instead I looked for and found the same command in LoginAction.php. It just uses time(); so I made the following change Auth::user()->setPreference(UserInterface::PREF_TIMESTAMP_ACTIVE, (string) Carbon::now()->unix()); to Auth::user()->setPreference(UserInterface::PREF_TIMESTAMP_ACTIVE, (string) time());

This cleared the error for me. I'm not sure if it's the right or best solution, but I figured can't hurt to do it as it is done elsewhere in the app.

fanningert commented 8 months ago

Thanks, now corrected in 0.0.5