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
+3 -14
View File
@@ -58,23 +58,12 @@ storage = new Storage storage:global.localStorage
########################################################################################################################
{CraftingGuideClient} = require 'crafting-guide-common'
client = new CraftingGuideClient(
baseUrl: apiBaseUrl
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)->
client = _(new CraftingGuideClient(baseUrl:apiBaseUrl)).extend Backbone.Events
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()
########################################################################################################################
+1 -2
View File
@@ -71,10 +71,9 @@ module.exports = class SiteController extends BaseController
@router.navigate c.url.login(), trigger:true
logout: ->
@client.logout()
.then =>
@storage.store 'loginSecurityToken', null
@user = null
@client.logout()
.catch (error)->
logger.error -> "Failed to log out: #{error}"
.done()