Hi Waterhole team,
I'm using Waterhole v0.4.12 with Laravel 12.14.1.
Everything is installed and configured according to your official docs:
- Laravel guard is
web
App\Models\User
implementsAuthenticatesWaterhole
andHasWaterholeUser
toWaterholeUser()
returns a valid PendingUser- Waterhole's built-in auth is disabled (
auth.php
) - Session driver is
database
- SESSION_DOMAIN is
.kinksters.test
- Waterhole route prefix is
/forum
- Login override is done via
ForumRoutes::add()
as instructed
Repro Steps:
- Log in to the Laravel app via
/login
- Laravel session is created with
user_id = 2
- Visit
/debug-session
— showsauth_user: 2
and correct session key - Visit
/forum
- A new session is created with
user_id = null
- Waterhole does not detect the user and redirects to login
- Visiting
/login
returns to/dashboard
— infinite loop
What I've Tried:
- Rebinding user provider via
AppServiceProvider
- Creating middleware to manually sync session and log user in
- Manually booting session via a custom service provider
- Verified guard hashes (
login_web_xxx
) match via debug tools - Upgraded to Laravel 12 and cleared all caches
- All cookies and session IDs are shared correctly
- Session ID remains the same between
/
and/forum
Expected:
Waterhole should recognize the logged-in Laravel user and auto-link/create the corresponding wh_users
record.
This seems to be caused by Waterhole accessing the auth guard before Laravel has fully restored the session (especially under the Laravel 11+/12 bootstrap/app.php
lifecycle).
Any help or patch would be greatly appreciated. I can provide a minimal repro if needed.
Thanks for your hard work on Waterhole — it’s a fantastic project and I really want to use it in production.
3 Comments
Any update on this... i'm eager to implement onto a live site?
Hi @alyn jones,
Thanks for your patience. I have just tried to reproduce this issue with a fresh Laravel 12 installation but I can't seem to. If you could provide a minimal repro, I'd be happy to have a look.
If you're interested in digging more yourself, you can see Waterhole's middleware stack in
src/Providers/RouteServiceProvider.php
. The specific middleware that translates app auth into Waterhole auth isAuthenticateWaterhole
, which comes afterStartSession
. Perhaps you could throw a few debug statements in here - find out the value of$originalUser
etc.Hello @Toby,
just a quick update for you...
i turns out its an issue with my laravel setup as i was creating a repro for you and it works perfectly fine in the repro but not in my actual app.
im struggling to find what is breaking it in my laravel app.
in the cleanly installed waterhole-repo with fresh laravel 12 install and fresh waterhole it works absolutly fine but in my laravel app with the same setup as your docs it has session issue.
not sure what the problem is.