Commit bbef1395 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fux

parent 99edb79c
...@@ -14,6 +14,10 @@ const initialState = { ...@@ -14,6 +14,10 @@ const initialState = {
function reducer(state, action) { function reducer(state, action) {
switch (action.type) { switch (action.type) {
case "LOGIN":
localStorage.setItem("token", action.token);
return { ...state, token: action.token, user: action.user };
case "SET_TOKEN": case "SET_TOKEN":
localStorage.setItem("token", action.token); localStorage.setItem("token", action.token);
return { ...state, token: action.token }; return { ...state, token: action.token };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment