junaid oh ok, then what you have to do is: figure out the method or function where you're logging in the user and, when the login is successful, you can just add the code under "Configuration" in the docs (Flarum object creation, user method, login method).
Example with a simple login function:
use Maicol07\SSO\Flarum;
function login(string $username, string $email, string $password): void {
// ... all your login logic
$flarum = new Flarum([
// Configure with your options
]);
$user = $flarum->user($username);
$flarum_user->attributes->email = $email;
$flarum_user->attributes->password = $password;
$flarum_user->login();
}
You can also check the example on github to check where to place the code: maicol07/flarum-sso-php-plugintree/master/example