jquery - FOS UserBundle Login from external Site (use as API in Cordova) -
i have project utilizes fos userbundle login. want write cordova app logs in project , gets data provide via json.
i have this, works on local:
$.get('http://192.168.10.30/app_dev.php/login', function (data) { */ token */ var $result = $(data).find('input:hidden[name="_csrf_token"]'); $.post('http://192.168.10.30/app_dev.php/login_check', { _csrf_token: $result.val(), target_path: 'mainpage', _username: 'username', _password: 'password' }).done(function (postdata) { console.log(postdata); }); });
postdata
shows need. works on dev server, same origin.
moving app cause give me cross origin alert, know that. question is, right way approach such thing?
how else can "behind" login of project outside?
Comments
Post a Comment