Skip to content

Commit

Permalink
Fixing SSO logout.
Browse files Browse the repository at this point in the history
  • Loading branch information
longdogz committed Jul 27, 2017
1 parent f6dc7f2 commit aadcd72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/ui/app/scripts/controllers/SignInCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ angular.module('wasabi.controllers')
}
else {
if (ConfigFactory.authnType() === 'sso') {
window.location = ConfigFactory.noAuthRedirect();
window.location.href = ConfigFactory.noAuthRedirect();
}
else {
$scope.loginFailed = true;
Expand Down
11 changes: 8 additions & 3 deletions modules/ui/app/scripts/controllers/SignOutCtrl.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
'use strict';

angular.module('wasabi.controllers')
.controller('SignOutCtrl', ['$scope', '$rootScope', '$state', 'AuthFactory', 'AUTH_EVENTS',
function ($scope, $rootScope, $state, AuthFactory, AUTH_EVENTS) {
.controller('SignOutCtrl', ['$scope', '$rootScope', '$state', 'AuthFactory', 'AUTH_EVENTS', 'ConfigFactory',
function ($scope, $rootScope, $state, AuthFactory, AUTH_EVENTS, ConfigFactory) {
$scope.signOut = function () {
AuthFactory.signOut().$promise.then(function(/*result*/) {
//console.log(result);
$state.go('signin');
if (ConfigFactory.authnType() === 'sso') {
window.location.href = ConfigFactory.ssoLogoutRedirect();
}
else {
$state.go('signin');
}
}, function(/*reason*/) {
$scope.loginFailed = true;
$rootScope.$broadcast(AUTH_EVENTS.loginFailed);
Expand Down
1 change: 1 addition & 0 deletions modules/ui/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"supportEmail": "",
"authnType": "basic",
"noAuthRedirect": "",
"ssoLogoutRedirect": "",
"apiHostBaseUrlValue": "DEFAULT"
}

0 comments on commit aadcd72

Please sign in to comment.