vendredi 19 octobre 2018

ember simple auth isnt sending data as post request

i have an ember project using ember simple auth. Im trying to log in through my api which returns an access key but none of my login details seem to be getting sent.

Here is my authentication service. I have console logged the email etc and they are definitly getting passed through

import Service               from '@ember/service';
import { inject as service } from '@ember/service';

export default Service.extend({

    sessionService:    service('session'),

    authenticate: function(email, password, remember)
    {
        this.get('sessionService').authenticate('authenticator:oauth2', email, password, remember).then(() =>
        {

        }).catch((reason) =>
        {

        });
    },
});

Then in my App/Authenticators/oauth2.js I have:

import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';
import ENV from 'client/config/environment';

export default OAuth2PasswordGrant.extend({
    //serverTokenEndpoint: 'http://www.mocky.io/v2/5b559561320000b504827e41'
    serverTokenEndpoint: ENV.APP.apiRoot + '/login_request'
});

The api root is correct, on my api i am returning whatever email they have used for testing and its returning nothing which means nothing is getting sent. I can manually write out the url including the email and passwork and that works perfect but that would get a GET request.




Aucun commentaire:

Enregistrer un commentaire