Malina this is not officially possible.
We recommend using oauth integrations to integrate Flarum login with another system. The FoF Passport extension can be used, or you can create your own login integration using a League OAuth controller.
Since Flarum comes with its own router, and IoC container and mixes Symfony and Laravel components, it would be very difficult to implement into an existing codebase.
However depending on the complexity of your app, you might be able to do the opposite and turn your existing app into a Flarum extension and use Flarum as the framework in place of Symfony/Laravel.