Remove experimental session storage mechanism

This commit is contained in:
Andrew Miner
2016-04-06 21:19:32 -07:00
parent 6650413e59
commit 5877a3234f
2 changed files with 8 additions and 20 deletions
+6 -17
View File
@@ -25,7 +25,7 @@ Backbone.$ = $
global.logger = new Logger global.logger = new Logger
marked = require 'marked' marked = require 'marked'
marked.setOptions sanitize: true marked.setOptions sanitize:true
######################################################################################################################## ########################################################################################################################
@@ -58,23 +58,12 @@ storage = new Storage storage:global.localStorage
######################################################################################################################## ########################################################################################################################
{CraftingGuideClient} = require 'crafting-guide-common' {CraftingGuideClient} = require 'crafting-guide-common'
client = new CraftingGuideClient( client = _(new CraftingGuideClient(baseUrl:apiBaseUrl)).extend Backbone.Events
baseUrl: apiBaseUrl client.onStatusChanged = (client, oldStatus, newStatus)->
logger.info "Crafting Guide server status changed from #{oldStatus} to #{newStatus}"
client.trigger 'change:status', client, oldStatus, newStatus
client.trigger 'change', client
session: storage.load CraftingGuideClient.SESSION
onSessionChanged: (client, oldSession, newSession)->
logger.info "Updated server session data"
storage.store CraftingGuideClient.SESSION, session
client.trigger 'change:session', client, oldSession, newSession
client.trigger 'change', client
onStatusChanged: (client, oldStatus, newStatus)->
logger.info "Crafting Guide server status changed from #{oldStatus} to #{newStatus}"
client.trigger 'change:status', client, oldStatus, newStatus
client.trigger 'change', client
)
_(client).extend Backbone.Events
client.checkStatus() client.checkStatus()
######################################################################################################################## ########################################################################################################################
+2 -3
View File
@@ -71,10 +71,9 @@ module.exports = class SiteController extends BaseController
@router.navigate c.url.login(), trigger:true @router.navigate c.url.login(), trigger:true
logout: -> logout: ->
@storage.store 'loginSecurityToken', null
@user = null
@client.logout() @client.logout()
.then =>
@storage.store 'loginSecurityToken', null
@user = null
.catch (error)-> .catch (error)->
logger.error -> "Failed to log out: #{error}" logger.error -> "Failed to log out: #{error}"
.done() .done()