mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
29 lines
643 B
JavaScript
29 lines
643 B
JavaScript
define([
|
|
'angular',
|
|
'config',
|
|
],
|
|
function (angular) {
|
|
'use strict';
|
|
|
|
var module = angular.module('grafana.controllers');
|
|
|
|
module.controller('ChangePasswordCtrl', function($scope, backendSrv, $location) {
|
|
|
|
$scope.command = {};
|
|
|
|
$scope.changePassword = function() {
|
|
if (!$scope.userForm.$valid) { return; }
|
|
|
|
if ($scope.command.newPassword !== $scope.command.confirmNew) {
|
|
$scope.appEvent('alert-warning', ['New passwords do not match', '']);
|
|
return;
|
|
}
|
|
|
|
backendSrv.put('/api/user/password', $scope.command).then(function() {
|
|
$location.path("profile");
|
|
});
|
|
};
|
|
|
|
});
|
|
});
|