1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

feat: Store accessToken in cookies instead of localStorage

This commit is contained in:
Maksim Eltyshev 2022-04-26 18:01:55 +05:00
parent cad3233da7
commit 7ef55ec578
27 changed files with 137 additions and 114 deletions

View file

@ -1,19 +1,12 @@
import { getAccessToken } from '../utils/access-token-storage';
import ActionTypes from '../constants/ActionTypes';
const initialState = {
accessToken: getAccessToken(),
userId: null,
};
// eslint-disable-next-line default-param-last
export default (state = initialState, { type, payload }) => {
switch (type) {
case ActionTypes.AUTHENTICATE__SUCCESS:
return {
...state,
accessToken: payload.accessToken,
};
case ActionTypes.SOCKET_RECONNECT_HANDLE:
case ActionTypes.CORE_INITIALIZE:
return {