0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/client/initializers/current-user.js
Jacob Gable 42a1d55858 Improve signin
Ref #2413

- Remove fixture and use actual API
- Store and send down actual logged in user data
- Refactor isLoggedIn to use computed property on application
- After signin, update user data in dependency container
- Add CSRF to all routes and controllers via initializer
- Update authenticated route to check for user.isLoggedIn
- Add notifications for signin error
- Add notifications.showAPIError helper
- Add plumbing for refreshless signup to doSignUp in admin controller
2014-05-15 09:18:43 -05:00

14 lines
No EOL
410 B
JavaScript

import User from 'ghost/models/user';
export default {
name: 'currentUser',
initialize: function (container, application) {
var user = User.create(application.get('user') || {});
container.register('user:current', user, { instantiate: false });
container.injection('route', 'user', 'user:current');
container.injection('controller', 'user', 'user:current');
}
};