Laravel – Login persistence using Firebase phone auth and Flutter

Im using Flutter to develop a small app which uses Firebase to authenticate the clients using their phone number.
The process is simple, the client uses Firebase (directly from the app) to authenticate his phone number and retrieve a token, then the app will make an API call to my Laravel based server to check if the client’s account exists and then retrieve his info and log him into the app.
The problem is, how do i keep the client logged-in after he closes the app ? i know that Firebase can keep a login instance, but i cant rely on Firebase to tell if a client can login or not (there is a banning system).

Should i return a token when the client has been logged in and save it on the phone and reuse it next time ?

Source: Laravel

Leave a Reply