finish rudimentary auth flow

This commit is contained in:
41666 2017-12-10 05:26:56 -06:00
parent 90f302c103
commit cfc623b228
10 changed files with 101 additions and 15 deletions

View file

@ -1,6 +1,7 @@
import { Map } from 'immutable'
const initialState = Map({
isLoggedIn: false,
username: 'あたし',
discriminator: '0001',
id: '',
@ -9,10 +10,12 @@ const initialState = Map({
export default (state = initialState, { type, data }) => {
switch (type) {
case Symbol.for('set user'):
return Map(data)
return Map({...data, isLoggedIn: true})
case Symbol.for('reset user'):
return initialState
default:
return state
}