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

Not able to make request with Angular 8 #124

Open
IsabelaLiberatoscioli opened this issue May 21, 2020 · 1 comment
Open

Not able to make request with Angular 8 #124

IsabelaLiberatoscioli opened this issue May 21, 2020 · 1 comment

Comments

@IsabelaLiberatoscioli
Copy link

IsabelaLiberatoscioli commented May 21, 2020

Hello,
I am using Angular 8 with Django and I'm trying to retrieve JWT token using POST 'api/login/social/jwt-pair/', but I'm no able to accomplish this.
If I make a request like this, using HttpClient:

this.http.post(
      'http://localhost:8000/api/login/social/jwt-pair/',
       {  provider : 'facebook', code:  'XXXXXXXXX' },
      {
        headers: new HttpHeaders()
        .set('Content-Type', 'application/x-www-form-urlencoded'),
      }
    );

All I receive is:
Provider is not specified
Bad Request: /api/login/social/jwt-pair/

Also tried:

this.http.post(
      'http://localhost:8000/api/login/social/jwt-pair/',
       JSON.stringify({  provider : 'facebook', code:  'XXXXXXXXX' }),
      {
        headers: new HttpHeaders()
         .set('Content-Type', 'application/json')
      }
    );

But all I receive is:

Not Found: /api/login/social/jwt-pair/

What am I doing wrong??? All my posts in my API work but this one doesn't.
I even tried to have a middleware so I could format the request.data and it be accepted by post method, but it doesn't work either, I keep receiving the same messages. Even though my middleware is able to get the provider from request. I don't know what I am missing, can anyone help?

@alexanderblackh
Copy link

alexanderblackh commented Aug 8, 2020

Did you ever find an answer to this? Having this issue as well with AppleID.

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

2 participants