define([], function() {
    'use strict';

    /**
     * Session Service stores current user data
     */
    SessionService.$inject = ['$q', 'storage'];
    function SessionService($q, storage) {

        var TOKEN_KEY = 'sess:id',
            IDENTITY_KEY = 'sess:user',
            defer;

        this.token = storage.getItem(TOKEN_KEY);
        this.identity = storage.getItem(IDENTITY_KEY);

        /**
         * Get identity when available
         *
         * @returns {object} promise
         */
        this.getIdentity = function() {
            defer = defer ? defer : $q.defer();
            return defer.promise;
        };

        /**
         * Start a new session
         *
         * @param {string} token
         * @param {object} identity
         */
        this.start = function(token, identity) {
            this.token = token;
            this.identity = identity;

            storage.setItem(TOKEN_KEY, token);
            storage.setItem(IDENTITY_KEY, identity);

            if (defer) {
                defer.resolve(identity);
                defer = null;
            }
        };

        /**
         * Set current session expired
         */
        this.expire = function() {
            this.token = null;
            storage.removeItem(TOKEN_KEY);
        };

        /**
         * Clear session info
         */
        this.clear = function() {
            this.expire();
            this.identity = null;
            storage.removeItem(IDENTITY_KEY);
        };
    }

    return SessionService;
});

@@ -305,24 +305,31 @@
 is.token = s
+essionS
 torage.getIt
@@ -904,32 +904,39 @@
 ;%0A%0A            s
+essionS
 torage.setItem(T
@@ -1263,32 +1263,39 @@
 l;%0A            s
+essionS
 torage.removeIte

store auth token into session storage