Login with SQLite

I have an application connected to a MySQL database.
Until now users can register and log in.

But now I need user access data to be stored in a SQLite database so they can log in even with the device disconnected from the internet.

Please help me :frowning:

I hope I’m misunderstanding you, because if not, what you describe is impossible.

“Register” and “log in” are concepts that make sense if the mobile app is talking to a server that you control. They make zero sense if the mobile app is effectively talking to itself. It is best to think of any asset included in a mobile app, including SQLite databases, is accessible to anybody with a copy of the app binary.

Attempting to replicate server-side login logic by storing passwords on device goes beyond useless and into actively harmful. Don’t do that under any circumstances.

Have you already checked the documentation for ionic-storage? https://ionicframework.com/docs/storage/

Hello! Thanks for answering

I just need to save a copy of the user and password in SQLite after the first login to allow access even if the device is disconnected from the internet.

No you don’t. This is an extremely bad idea.

Access to what? The only things protected by access control are on servers that need to be accessed over the internet, so if the device is offline, there can be no access to them.

You could store the access token the database provides after authentication. That’s standard, and much less dangerous. But I have no idea what you mean by logging in when disconnected from the internet.

So Is there any documentation or tutorial available for storing the data on server using mysql?
and I want to use Node.Js as backend to be specific.

one more thing. If I use Node.Js for backend is that will be useful for PWA app? My focus is mostly on PWA app.