Hello everyone.
I'm currently running a web app, made in Laravel 5.3.
What I'm looking to do is integrate Flarum with it.
More precisely, I want to have members logged into the forum when they log in into the web app, and the same for log out. Only members of the web app should have an account.
What I did until now is the following:
1. Installed Flarum into the same DB as my webapp with the flarum_ DB prefix.
2. Disabled registration in Flarum itself.
3. Ported all accounts from my users table to the flarum_users table.
4. Created a field in my webapp users table containing the ID of the flarum_users entry so I can later pull info from my webapp's user table.
So, all members can now log in to the forum using the same DB credentials.
What is left is to integrate the login,
My idea was to do something like this in my web app:
// code to login the user to the web app is here
Flarum::loginUserWithId($webAppUser->flarum_id);
How would I go about doing this? Is there a better way?
Thanks.
Regards!