Problem on login


i was tried to create a entire system for loan management and i face some issues regards system user login and register

i know the sync gateway is the only way to communicate couchbase server,but while register i need to check the user details are already exist or not in the database i don’t want to keep all users details in mobile

and also i need to filter data basis on user id it’s possible?

Hi @yafeearun, to tackle your user registration needs you need a server-side resource that can access Sync Gateway’s Admin REST API, per the documentation:

You manage accounts by using the Admin REST API.This interface is privileged and for administrator use only. To manage accounts, you need to have some other server-side mechanism that calls through to this API.

An example of this approach that uses Node.js can be found here: Couchbase-by-Example/08-signup-and-login.

hi @jkurtz

thanks for your reply

i don’t wanna to keep user data in mobile how i block it while sync with server

and i have one more doubt on login . while try to login the user must be in online it’s not works on offline right?

Maybe I am missing something - but I would expect that your app will support some sort of login /registration interface where user will have to enter their credentials before logging in. Once credentials are entered, you can authenticate it against your server.
The replication should start only when the credentials are authenticated against the server.
You will provide the authentication parameters as part of the replication .Every user should have their own Couchbase Lite DB.

hi @priya.rajagopal

thanks for your reply

i’m confused on your words please give me some examples

please let help me to solve this issue.

You may want to take a look at the login workflow implemented in our sample app. Follow the flow when kLoginFlowEnabled flag is true.

As indicated above, I am not entirely clear on your use case but the above sample code may be a good starting point