refstack/refstack-ui/app/components/auth-failure/authFailureController.js
sslypushenko 4624c926fd Improve authentication alerts
If OpenStackID returns failure user will be shown failure message.
Steps to check:
Setup RefStack as usual but point REFSTACK_HOST=127.0.0.1. It will
cause OpenStackID auth failure. So try to auth and you should get
error message in popup (instead of plain json document as it was before).

Change-Id: Icda5b219429047e89b393245a3a6eeadf171bd90
2015-09-03 15:41:17 -07:00

18 lines
498 B
JavaScript

/**
* Refstack Auth Failure Controller
* This controller handles messages from Refstack API if user auth fails.
*/
var refstackApp = angular.module('refstackApp');
refstackApp.controller('authFailureController',
[
'$stateParams', '$state', 'raiseAlert',
function($stateParams, $state, raiseAlert) {
'use strict';
raiseAlert('danger', 'Authentication Failure:',
$stateParams.message);
$state.go('home');
}
]);