fix auth
This commit is contained in:
parent
9a0c180b37
commit
5f10149b2a
|
@ -21,7 +21,6 @@ angular.module('ffhb', [
|
|||
amMoment.changeLocale('de');
|
||||
$rootScope.globals = $cookieStore.get('globals') || {};
|
||||
if ($rootScope.globals.currentUser) {
|
||||
$rootScope.passphrase = '*****';
|
||||
$http.defaults.headers.common['Authorization'] = 'Basic ' + $rootScope.globals.currentUser.authdata; // jshint ignore:line
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,6 +21,6 @@
|
|||
a.btn.btn-link(ng-click="refresh()")
|
||||
span.glyphicon.glyphicon-refresh(aria-hidden="true")
|
||||
| {{timeRefresh}} Sec
|
||||
form.navbar-form.navbar-right
|
||||
form.navbar-form.navbar-right(ng-class="{'has-warning':globals.currentUser.authdata}")
|
||||
input.form-control(type="password",ng-change="passphraseUpdate()",ng-model="passphrase",placeholder="Passphrase")
|
||||
div(ui-view="",style="margin-top:100px;")
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('ffhb')
|
||||
.controller('MainCtrl',function($rootScope,$scope,$interval,store,$state,AuthenticationService){
|
||||
.controller('MainCtrl',function($scope,$interval,store,$state,AuthenticationService){
|
||||
$scope.isOpen = false;
|
||||
$scope.$state = $state;
|
||||
$scope.refresh = store.refresh;
|
||||
if($rootScope.passphrase === undefined){
|
||||
$rootScope.passphrase = '';
|
||||
}
|
||||
$scope.passphrase = '';
|
||||
|
||||
var timediff = new Date(1970,1,1);
|
||||
|
||||
function render(prom){
|
||||
|
@ -30,9 +29,6 @@ angular.module('ffhb')
|
|||
|
||||
|
||||
$scope.passphraseUpdate = function(){
|
||||
if($rootScope.passphrase !== undefined && $rootScope.passphrase !== '' && $rootScope.passphrase !== '*****'){
|
||||
console.log("set new basicauth");
|
||||
AuthenticationService.SetCredentials('client',$rootScope.passphrase);
|
||||
}
|
||||
AuthenticationService.SetCredentials('client',$scope.passphrase);
|
||||
};
|
||||
});
|
||||
|
|
|
@ -133,7 +133,7 @@ angular.module('ffhb')
|
|||
result.resolve(true);
|
||||
myservice.refresh(true);
|
||||
},function(){
|
||||
$rootScope.passphrase = '';
|
||||
$rootScope.globals.passphrase = '';
|
||||
});
|
||||
}else{
|
||||
result.resolve(false);
|
||||
|
|
Loading…
Reference in New Issue