2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
6 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
20 .controller('LogoutController', LogoutController);
22 LogoutController.$inject = [
23 '$location', '$window', '$timeout'
27 * TestAPI Logout Controller
28 * This controller handles logging out. In order to fully logout, the
29 * openstackid_session cookie must also be removed. The way to do that
30 * is to have the user's browser make a request to the openstackid logout
31 * page. We do this by placing the logout link as the src for an html
32 * image. After some time, the user is redirected home.
34 function LogoutController($location, $window, $timeout) {
37 ctrl.openid_logout_url = $location.search().openid_logout;
38 var img = new Image(0, 0);
39 img.src = ctrl.openid_logout_url;
40 ctrl.redirectWait = $timeout(function() {
41 $window.location.href = '/';