0
votes

I am reading documentation of the Ember Simple Auth. I want to send authorized ajax request (outside of the Ember store).

I've found out there is a method for that. However when I try it to call inside my component, I get error "TypeError: this.get(...).authorize is not a function". What am I doing wrong?

Here's my code:

import Ember from "ember";

export default Ember.Component.extend({
    session: Ember.inject.service('session'),
    actions: {
        del: function() {
            var self = this;
            console.log(this.get('session'));
            this.get('session').authorize('authorizer:oauth2-bearer', function(header, content) {
                ...
            });
        }
    }
});
1
Did you create the authenticator in app/authenticators/oauth2-bearer? - marcoow

1 Answers

0
votes

One rule you should apply when you upgrade ember plugin - make sure the older NPM version is uninstalled properly - or you will have many, many problems like I had.

Uninstalling the older version completly solved my problem.