Show user's name upon successful login

This commit is contained in:
Francis Lachapelle
2016-08-31 14:32:30 -04:00
parent c2a0994aed
commit ab4118fb29
5 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
"Authenticating" = "Authenticating";
/* Appears when authentication succeeds */
"Success" = "Success";
"Welcome" = "Welcome";
"Authentication Failed" = "Authentication Failed";
"Wrong username or password." = "Wrong username or password.";
+1 -1
View File
@@ -126,7 +126,7 @@
ng-switch-when="logged">
<md-icon class="md-accent md-hue-1 sg-icon--large">done</md-icon>
<div class="md-default-theme md-accent md-hue-1 md-fg md-padding">
<var:string label:value="Success"/>
<var:string label:value="Welcome"/> {{app.cn}}
</div>
</div>
@@ -120,7 +120,7 @@
//showPasswordDialog('expiration', createPasswordExpirationDialog, data['expire']);
}
else {
d.resolve(redirectUrl(username, domain));
d.resolve({ cn: data.cn, url: redirectUrl(username, domain) });
}
}
else {
+4 -3
View File
@@ -25,15 +25,16 @@
function login() {
vm.loginState = 'authenticating';
Authentication.login(vm.creds)
.then(function(url) {
.then(function(data) {
vm.loginState = 'logged';
vm.cn = data.cn;
// Let the user see the succesfull message before reloading the page
$timeout(function() {
if (window.location.href === url)
if (window.location.href === data.url)
window.location.reload(true);
else
window.location.href = url;
window.location.href = data.url;
}, 1000);
}, function(msg) {
vm.loginState = 'error';