chore: 🤖 Fix lint errors

Fix lint errors
This commit is contained in:
Carlos Alcaide committed 2021-06-01 11:07:48 -07:00
1 parent 28d18e389c
commit 77d7187116
4 files changed
+10 -10

No files matched your search

+2 -3
View File
@@ -76,9 +76,8 @@ export default class StorageService extends Service {
const inMemory = get(config, 'storage.memory');
// Get the global context object (window) via service lookup,
// because just reaching for a global is icky
const globalContext =
getOwner(this).lookup('service:-document').documentElement.parentNode
.defaultView;
const globalContext = getOwner(this).lookup('service:-document')
.documentElement.parentNode.defaultView;
// If memory storage enabled, return the memory storage instance,
// otherwise return localStorage.
return inMemory ? this.#memoryStorage : globalContext.localStorage;
+4 -3
View File
@@ -72,9 +72,10 @@ export default class BaseAuthenticator extends SimpleAuthBaseAuthenticator {
*/
async restore(data) {
if (!data) return reject();
return this.validateToken(data.attributes.token, data.attributes.id).then(
() => this.normalizeData(data)
);
return this.validateToken(
data.attributes.token,
data.attributes.id
).then(() => this.normalizeData(data));
}
/**
+2 -2
View File
@@ -76,8 +76,8 @@ export default class OIDCAuthenticator extends BaseOIDCAuthenticator {
* @param {string} token
*/
addTokenToAuthorization(token) {
const adapterPrototype =
this.store.adapterFor('application').constructor.prototype;
const adapterPrototype = this.store.adapterFor('application').constructor
.prototype;
const headers = adapterPrototype?.headers;
if (!headers) adapterPrototype.headers = {};
adapterPrototype.headers.Authorization = null;
+2 -2
View File
@@ -91,8 +91,8 @@ export default class PasswordAuthenticator extends BasePasswordAuthenticator {
* @param {string} token
*/
addTokenToAuthorization(token) {
const adapterPrototype =
this.store.adapterFor('application').constructor.prototype;
const adapterPrototype = this.store.adapterFor('application').constructor
.prototype;
const headers = adapterPrototype?.headers;
if (!headers) adapterPrototype.headers = {};
adapterPrototype.headers.Authorization = null;