Page 1 of 1

login to appery DB with facebook credentials

Posted: Wed May 13, 2015 11:24 am
by Michael4771079

Hi,
I have a facebook login service which works and returns user id and last name as requested.

So I am trying to login to appery DB using facebook "id" as name and "last name" as pass.

I set it up and on success of facebook,

invoke appery login and this works if user is already in appery DB and js navigation to profile screen follows.

If it a new user opens the app, facebook works as expected and it throws the error on appery login which is OK cause user is not registered,

So I have the appery signup service set to run on error but it doesnt invoke the service being called after the error of appery login service

Is there a good way to implement this?

Here is a screenshot so you can see the setup.
All services FB, appery login and signup services all run fine as stand alone services

Thanks

Image


login to appery DB with facebook credentials

Posted: Wed May 13, 2015 1:24 pm
by Serhii Kulibaba

Hello Michael,

Please follow this tutorial:
https://devcenter.appery.io/tutorials...


login to appery DB with facebook credentials

Posted: Wed May 13, 2015 1:32 pm
by Michael4771079

Sergily,
that doesnt contain any info regarding loggin to appery DB after FB login as I explained above.

Maybe I didnt explain clearly

FB login is sorted it runs fine.

Im trying to do a secret login or signup to appery DB on success or error of FB Me service using facebook returned user credentials


login to appery DB with facebook credentials

Posted: Thu May 14, 2015 10:42 am
by Serhii Kulibaba

I understood. You should read user's name and sign it up to appery db. User's email you can use as password for it's registration. https://devcenter.appery.io/documenta...


login to appery DB with facebook credentials

Posted: Thu May 14, 2015 10:54 am
by Michael4771079

the signup and login services are already working as expected

I am tring to run these services on success and error events of the working FB login

So on success of FB login I run sign up service
All works fine if this is a new user.

If its a user who is already registered to appery DB it will throw an error user already exists want to run appery login service on this error

Its already setup as per screenshot above but when the error is thrown the login service doesnt fire


login to appery DB with facebook credentials

Posted: Mon May 18, 2015 5:37 pm
by Serhii Kulibaba

You should check the error message, and invoke login service only if it is "user already exists". Please add JS that invokes alerts on error and success events to see their order of execution.