Add ConfigStore
This commit is contained in:
parent
ca867e871d
commit
bb5203ca42
2 changed files with 24 additions and 0 deletions
20
app/session-stores/application.js
Normal file
20
app/session-stores/application.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import EphemeralStore from 'ember-simple-auth/session-stores/ephemeral';
|
||||||
|
import LocalStorageStore from 'ember-simple-auth/session-stores/local-storage';
|
||||||
|
import config from 'meiliadmin/config/environment';
|
||||||
|
|
||||||
|
const settings = config?.APP?.meilisearch;
|
||||||
|
|
||||||
|
class ConfigStore extends EphemeralStore {
|
||||||
|
restore() {
|
||||||
|
const result = {
|
||||||
|
authenticated: Object.assign(
|
||||||
|
{ authenticator: 'authenticator:meilisearch' },
|
||||||
|
settings
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
return Promise.resolve(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default settings ? ConfigStore : LocalStorageStore;
|
||||||
|
|
@ -16,6 +16,10 @@ module.exports = function (environment) {
|
||||||
APP: {
|
APP: {
|
||||||
// Here you can pass flags/options to your application instance
|
// Here you can pass flags/options to your application instance
|
||||||
// when it is created
|
// when it is created
|
||||||
|
// meilisearch: {
|
||||||
|
// url: 'http://localhost:7700',
|
||||||
|
// key: 'MASTER_KEY',
|
||||||
|
// },
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue