V
V
Veryssshh2020-01-02 01:51:17
Java
Veryssshh, 2020-01-02 01:51:17

How to separate users after authorization?

I screwed up a simple registration on SQLite. Each user has its own id. It is also possible to add posts to the wall. The problem is that users are not separated in any way. I don't know how to get the id of the user who is currently logged in (as in php, for example, through sessions), so that I can add posts according to their id and display only them. Suitable for these purposes SQLite? Or should I use Firebase or something? I ask for advice on how to implement all this. Or some tutorial. I don't know how to google it properly. Thank you all in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2020-01-02
Hasanly @azerphoenix

I screwed up a simple registration on SQLite. Each user has its own id.

Registration was implemented, but apparently they forgot to implement authorization and authentication. Otherwise you wouldn't have the question:
Я не знаю, как получить id пользователя, который сейчас авторизован

Suitable for these purposes SQLite?

The DB has no role to play for this.
Actually your question is not entirely clear. Is the application client-server? If so, is jwt auth implemented on the server?
If I understand correctly, then you have an application in which a user can create multiple accounts. And depending on which account he uses at a particular moment, you want to create posts on behalf of the current user. Those. this is not a client-server application, but an application in which there is a local registration of several accounts, right?
Read this article here - https://developer.android.com/training/id-auth
Maybe it will be useful for you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question