--- a/client/src/reducers/authReducer.js Tue Jul 25 19:11:26 2017 +0200
+++ b/client/src/reducers/authReducer.js Fri Jul 28 19:40:35 2017 +0200
@@ -2,6 +2,7 @@
import * as types from '../constants/actionTypes';
import UserRecord from '../store/userRecord';
import asyncRequest from '../constants/asyncRequest';
+import uuidV4 from 'uuid/v4';
export const isAuthenticated = (state = false, action) => {
switch (action.type) {
@@ -44,6 +45,19 @@
}
}
+export const clientId = (state = null, action) => {
+ switch (action.type) {
+ case types.AUTH_DEAUTHENTICATE:
+ case types.AUTH_LOGOUT:
+ return null;
+ case types.AUTH_LOGIN_SUCCESS:
+ return uuidV4();
+ default:
+ return state;
+ }
+
+}
+
export const login = (state = asyncRequest, action) => {
switch (action.type) {
case types.AUTH_LOGIN_REQUEST: