I'm trying to upgrade our apps to 2.1.0. When doing so I see the following deprecation:
WARN: DEPRECATION: Ember Simple Auth: The authorize method should no longer be used. Instead, set the headers property or implement it as a computed property. [deprecation id: ember-simple-auth.data-adapter-mixin.authorize]
So I follow the upgrade guide and replace the authorize function with a header computed prop on the adapter. Now I continue to get the deprecation above and the following error:
ERROR: Error while processing route: index Assertion Failed: The `authorize` method should be overridden in your application adapter. It should accept a single argument, the request object. Error: Assertion Failed: The `authorize` method should be overridden in your application adapter. It should accept a single argument, the request object.
Not sure how to move forward with the upgrade. Thanks!
I have exactly this issue.
My current work around is to add a stub authorize method, this removes the error but gives me the annoying deprecation warning.
authorize(request) {
console.log("overriding authorize method because reasons");
}
This is because of following change 0169ee977e2094ac87c8971324a1910bd9b798b2. The deprecation is in the else if authorizer-property is not set. I did not found a solution yet. Overwriting ajaxOptions-method in your adapter does not work, because you need the execution of ember.js-Adapter::ajaxOptions. Therefore you cannot skip DataAdapterMixin::ajaxOptions.
I think we need a release of ember-simple-auth 3
This has already been addressed in https://github.com/simplabs/ember-simple-auth/pull/2010. We can probably expect this fix in v2.2.0
The fix for this was released in https://github.com/simplabs/ember-simple-auth/releases/tag/2.1.1
Most helpful comment
The fix for this was released in https://github.com/simplabs/ember-simple-auth/releases/tag/2.1.1