javascript - Expecting a token named "token -
i can't figure out what's causing error https://github.com/sahat/satellizer
satellize.js configurations
withcredentials: !1, tokenroot: null, cordova: !1, baseurl: "/#", loginurl: "/auth/login", signupurl: "/auth/signup", unlinkurl: "/auth/unlink/", tokenname: 'token', tokenprefix: "satellizer", authheader: "authorization", authtoken: "bearer", storagetype: "localstorage", app.js .config(function($authprovider) {
$authprovider.facebook({ clientid: '******' }); $authprovider.google({ clientid: '****' }); }) controller
$scope.sociallogin = function(provider) { $auth.authenticate(provider) .then(function(data) { toastr.success('you have signed in ' + provider + '!'); $rootscope.$broadcast('session',2) }) .catch(function(error) { if (error.error) { // popup error - invalid redirect_uri, pressed cancel button, etc. toastr.error(error.error); } else if (error.data) { // http response error server toastr.error(error.data.message, error.status); } else { toastr.error(error); } }); }; expecting token named token error here
service called on broadcast api/me 404 error here
var app = angular.module('app'); app.factory('account', function($http) { return { getprofile: function() { return $http.get('api/me'); }, updateprofile: function(profiledata) { return $http.put('api/me', profiledata); } }; }); i've tried variations on github page there doesn't seem solid solution this.
thought might because of # in url changed base url /# , got error.
i added
$locationprovider.html5mode({ enabled: true, requirebase: false }); that doesn't work either, doing wrong?
i think error when returning json response server. format of json response should in format.
{ "token" : "eyjhbgcioijiuzi1niisinr5cci6ikpxvcj9.eyjpc3mioij0b3b0ywwuy29tiiwizxhwijoxndi2ndiwodawlcjodhrwoi8vdg9wdgfslmnvbs9qd3rfy2xhaw1zl2lzx2fkbwluijp0cnvllcjjb21wyw55ijoivg9wdgfsiiwiyxdlc29tzsi6dhj1zx0.yrqynwzskczuxpwaqupwkiuzkelz49em7owxaqk_zxw"} so check json response getting. , if need more info on check issues tab of github link have provided.
Comments
Post a Comment