Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmantz committed Jan 13, 2017
1 parent bef4397 commit bd6d2d6
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/oidcMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { userExpired, userFound, loadingUser } from './actions';
import co from 'co';


// store the user here to prevent future promise calls to getUser()
export let storedUser = null;

Expand All @@ -15,7 +14,6 @@ export function removeStoredUser() {
storedUser = null;
}


export function errorCallback(error) {
console.error('Error in oidcMiddleware', error);
}
Expand All @@ -40,24 +38,6 @@ export default function createOidcMiddleware(userManager) {
throw new Error('You must provide a user manager!');
}

/*
// check for an interrupted login attempt and clear storage if necessary
co(function* () {
let value = yield Promise.resolve(storage.get(STORAGE_KEY));
if (value && locationService.currentPath.indexOf(callbackRoute) === -1) {
yield Promise.resolve(storage.remove(STORAGE_KEY));
// clear out any temporary data left behind by the userManager but keep the valid user data if present
let keys = yield Promise.resolve(storage.getAllKeys());
for (const key in keys) {
if (key.indexOf('oidc') !== -1 && key.indexOf('oidc.user') === -1) {
Promise.resolve(storage.remove(key));
}
}
}
});
*/

// the middleware
return (store) => (next) => (action) => {
co(middlewareHandler(next, action, userManager)).catch(errorCallback);
Expand Down

0 comments on commit bd6d2d6

Please sign in to comment.