Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests sent by $auth send parameters as text/plain #349

Open
Tresky opened this issue Feb 20, 2017 · 0 comments
Open

Requests sent by $auth send parameters as text/plain #349

Tresky opened this issue Feb 20, 2017 · 0 comments

Comments

@Tresky
Copy link

Tresky commented Feb 20, 2017

I just began using this package yesterday and I can't seem to get my login requests to be received correctly. I am using Angular 1.6 on the front-end with an ExpressJS backend.

The code I'm sending the request with:

$auth.submitLogin(vm.loginCreds)
        .then((response) => {
          $log.log('Success', response)
        }, (response) => {
          $log.log('Failure', response)
        })

Here is the request that is sent as well as the response:
screen shot 2017-02-20 at 12 38 15 pm

The thing that I notice is that the parameters are there, but the Content-Type is text/plain. I would expect a normal $http request to be sent using application/json.

To add to this, whenever the request gets to my server, the parameters are non-existent. I am using a top-level middleware in Express to print out all requests that come through and the body of the request that comes in has: req.body == {}. I think this is because the server is meant to accept JSON parameters, but the requests are leaving the browser in plain text, however I am not certain that this is the issue.

Any thoughts on this would be much appreciated.

All the best,
Tresky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant