mirror of
https://github.com/flarum/core.git
synced 2025-07-31 21:50:50 +02:00
Move forum ember app into a subdir, preparing for admin app to exist alongside
This commit is contained in:
20
ember/forum/app/initializers/preload-data.js
Normal file
20
ember/forum/app/initializers/preload-data.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default {
|
||||
name: 'preload-data',
|
||||
after: 'ember-data',
|
||||
initialize: function(container) {
|
||||
var store = container.lookup('store:main');
|
||||
if (!Ember.isEmpty(FLARUM_DATA)) {
|
||||
store.pushPayload({included: FLARUM_DATA});
|
||||
}
|
||||
if (!Ember.isEmpty(FLARUM_SESSION)) {
|
||||
FLARUM_SESSION.user = store.getById('user', FLARUM_SESSION.userId);
|
||||
container.lookup('simple-auth-session:main').setProperties({
|
||||
isAuthenticated: true,
|
||||
authenticator: 'authenticator:flarum',
|
||||
content: FLARUM_SESSION
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user