mirror of https://github.com/portainer/portainer
fix(app): rewrite URLHelper to avoid an issue with minification
parent
7643f8d08c
commit
2ef8c0b33e
|
@ -1,6 +1,10 @@
|
|||
angular.module('portainer.app').service('urlHelper', function urlHelper($window) {
|
||||
this.getParameter = getParameter;
|
||||
this.cleanParameters = cleanParameters;
|
||||
angular.module('portainer.app')
|
||||
.factory('URLHelper', ['$window', function URLHelperFactory($window) {
|
||||
'use strict';
|
||||
var helper = {};
|
||||
|
||||
helper.getParameter = getParameter;
|
||||
helper.cleanParameters = cleanParameters;
|
||||
|
||||
function getParameter(param) {
|
||||
var parameters = extractParameters();
|
||||
|
@ -21,4 +25,6 @@ angular.module('portainer.app').service('urlHelper', function urlHelper($window)
|
|||
function cleanParameters() {
|
||||
$window.location.search = '';
|
||||
}
|
||||
});
|
||||
|
||||
return helper;
|
||||
}]);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
angular.module('portainer.app').controller('AuthenticationController', ['$q', '$scope', '$state', '$stateParams', '$sanitize', 'Authentication', 'UserService', 'EndpointService', 'StateManager', 'Notifications', 'SettingsService', 'urlHelper',
|
||||
function($q, $scope, $state, $stateParams, $sanitize, Authentication, UserService, EndpointService, StateManager, Notifications, SettingsService, urlHelper) {
|
||||
angular.module('portainer.app').controller('AuthenticationController', ['$q', '$scope', '$state', '$stateParams', '$sanitize', 'Authentication', 'UserService', 'EndpointService', 'StateManager', 'Notifications', 'SettingsService', 'URLHelper',
|
||||
function($q, $scope, $state, $stateParams, $sanitize, Authentication, UserService, EndpointService, StateManager, Notifications, SettingsService, URLHelper) {
|
||||
$scope.logo = StateManager.getState().application.logo;
|
||||
|
||||
$scope.formValues = {
|
||||
|
@ -105,7 +105,7 @@ angular.module('portainer.app').controller('AuthenticationController', ['$q', '$
|
|||
authenticatedFlow();
|
||||
}
|
||||
|
||||
var code = urlHelper.getParameter('code');
|
||||
var code = URLHelper.getParameter('code');
|
||||
if (code) {
|
||||
oAuthLogin(code);
|
||||
} else {
|
||||
|
@ -116,7 +116,7 @@ angular.module('portainer.app').controller('AuthenticationController', ['$q', '$
|
|||
function oAuthLogin(code) {
|
||||
return Authentication.OAuthLogin(code)
|
||||
.then(function success() {
|
||||
urlHelper.cleanParameters();
|
||||
URLHelper.cleanParameters();
|
||||
$state.go('portainer.home');
|
||||
})
|
||||
.catch(function error() {
|
||||
|
|
Loading…
Reference in New Issue