summaryrefslogtreecommitdiff
path: root/src/reducers
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-11 14:48:42 +0300
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:37 +0200
commitd7512ace72448242b392299cf459c9c72c8dbee5 (patch)
tree37ce113d5d47440139bfe357e9ad547063cd44f7 /src/reducers
parent737ce62470a13ae153788207719396e107252955 (diff)
Get Google authentication flow working
Diffstat (limited to 'src/reducers')
-rw-r--r--src/reducers/auth.js12
-rw-r--r--src/reducers/index.js2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/reducers/auth.js b/src/reducers/auth.js
new file mode 100644
index 00000000..0d01b300
--- /dev/null
+++ b/src/reducers/auth.js
@@ -0,0 +1,12 @@
+import {COMPLETE_LOGIN, LOG_OUT} from "../actions/auth";
+
+export const auth = (state = {}, action) => {
+ switch (action.type) {
+ case COMPLETE_LOGIN:
+ return action.payload;
+ case LOG_OUT:
+ return {};
+ default:
+ return state;
+ }
+};
diff --git a/src/reducers/index.js b/src/reducers/index.js
index 3974ce4a..4e35f6e8 100644
--- a/src/reducers/index.js
+++ b/src/reducers/index.js
@@ -1,7 +1,9 @@
import {combineReducers} from "redux";
+import {auth} from "./auth";
import {authorizations, authVisibilityFilter, newProjectModalVisible} from "./projects";
const rootReducer = combineReducers({
+ auth,
authorizations,
newProjectModalVisible,
authVisibilityFilter,