From a33dbd1e919e9b11b69cb735f81746db86f06d2f Mon Sep 17 00:00:00 2001 From: xAt0mZ Date: Fri, 26 Jul 2019 18:21:23 +0200 Subject: [PATCH] fix(oauth): state to follow OAuth 2 RFC against CSRF --- app/portainer/views/auth/authController.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/portainer/views/auth/authController.js b/app/portainer/views/auth/authController.js index f9c22f4d3..7bd3295cb 100644 --- a/app/portainer/views/auth/authController.js +++ b/app/portainer/views/auth/authController.js @@ -119,18 +119,12 @@ function($async, $q, $scope, $state, $stateParams, $sanitize, Authentication, Us } function generateState() { - if ($scope.state.OAuthProvider !== 'OAuth') { - return ''; - } const uuid = uuidv4(); LocalStorage.storeLoginStateUUID(uuid); return '&state=' + uuid; } function hasValidState(state) { - if ($scope.state.OAuthProvider !== 'OAuth') { - return true; - } const savedUUID = LocalStorage.getLoginStateUUID(); return savedUUID === state; }