Commit d91bac94 authored by Ray Schamp's avatar Ray Schamp Committed by GitHub

Merge pull request #644 from mewtaylor/issue/gh-643-null-redux

Fix GH-643: use empty string if no cookie value found
parents 300831c1 5cc6eb3e
......@@ -24,6 +24,8 @@ module.exports.getPermissions = function () {
return function (dispatch) {
jar.getUnsignedValue('scratchsessionsid', 'permissions', function (err, value) {
if (err) return dispatch(module.exports.setPermissionsError(err));
value = value || {};
return dispatch(module.exports.setPermissions(value));
});
};
......
......@@ -27,6 +27,8 @@ module.exports.getToken = function () {
return function (dispatch) {
jar.getUnsignedValue('scratchsessionsid', 'token', function (err, value) {
if (err) return dispatch(module.exports.setTokenError(err));
value = value || '';
return dispatch(module.exports.setToken(value));
});
};
......
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