android - Social Authentication in Ionic App using ngCordova-oauth -
i using ngcordova-oauth sign facebook , google. app working fine use inappbrowser
open webview , login. not detect if user has login in device.
how can achieved in ionic/cordova app if user has login in fb or google take token there rather open webview everytime , signing up?
how follows
1 - let user login first time via ngcordova-oauth
2 - authentication token
, save it, im using $localstorage
3 - when user opens app next time, send authentication token
server , validate (before step 1)
4 - if authentication token
valid, skip login , move on
5 - if user logs out
, clear authentication token
, invalidate step 3, , force log again
Comments
Post a Comment