mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
finish rudimentary auth flow
This commit is contained in:
parent
90f302c103
commit
cfc623b228
10 changed files with 101 additions and 15 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue