1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-16 03:06:27 +00:00

on Refactoring...

This commit is contained in:
Rokt33r
2015-08-17 01:10:08 +09:00
parent 932997259f
commit 23b8b49c00
59 changed files with 1960 additions and 2179 deletions

View File

@@ -2,17 +2,10 @@
var Reflux = require('reflux')
var request = require('superagent')
var AuthActions = require('../Actions/AuthActions')
var apiUrl = require('../../../config').apiUrl
var AuthStore = Reflux.createStore({
init: function () {
this.listenTo(AuthActions.login, this.login)
this.listenTo(AuthActions.register, this.register)
this.listenTo(AuthActions.logout, this.logout)
this.listenTo(AuthActions.updateProfile, this.updateProfile)
this.listenTo(AuthActions.refreshUser, this.refreshUser)
},
// Reflux Store
login: function (input) {
@@ -91,7 +84,7 @@ var AuthStore = Reflux.createStore({
},
logout: function () {
localStorage.removeItem('token')
localStorage.removeItem('user')
localStorage.removeItem('currentUser')
this.trigger({
status: 'loggedOut'
@@ -129,7 +122,7 @@ var AuthStore = Reflux.createStore({
return false
},
getUser: function () {
var userJSON = localStorage.getItem('user')
var userJSON = localStorage.getItem('currentUser')
if (userJSON == null) return null
return JSON.parse(userJSON)
}