user3423235
user3423235

Reputation: 65

satellizer is asking for a token?

I am using satellizer to make a signup form. But whenever i try to signup, it gives me this error

Error: Expecting a token named "token" but instead got: {"email":"[email protected]","id":11} at Object.angular.module.constant.provider.factory.shared.setToken (satellizer.js:312) at satellizer.js:420 at deferred.promise.then.wrappedCallback (angular.js:11682) at angular.js:11768 at Scope.$get.Scope.$eval (angular.js:12811) at Scope.$get.Scope.$digest (angular.js:12623) at Scope.ng.config.$provide.decorator.$delegate.proto.$digest (:844:31) at Scope.$get.Scope.$apply (angular.js:12915) at Scope.ng.config.$provide.decorator.$delegate.proto.$apply (:855:30) at done (angular.js:8450)

what is going wrong?

Upvotes: 0

Views: 880

Answers (1)

Glibo
Glibo

Reputation: 196

You are not doing anything wrong. Satellizer has http intereptors configured for those kind of stuff.

It expects when HTTP status is 200 (OK) from you to send him a JSON field "token" for example:

{token:'some token'}.

enter image description here

You can see here it is checking if you as a user have authentication already or if you set your httpInterceptors to true or false.

Send it some custom value for the beginning to figure out how it is working, play a bit with config. Everything is explained on a Github

Cheers.

Upvotes: 1

Related Questions