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:
parent
cad3233da7
commit
7ef55ec578
27 changed files with 137 additions and 114 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue