GUACAMOLE-96: Open "otpauth" link when user clicks on barcode.

This commit is contained in:
Michael Jumper committed 2018-02-04 19:45:18 -08:00
1 parent 78cde50df9
commit b9dba7ddf4
3 files changed
+13 -3

No files matched your search

@@ -21,8 +21,8 @@
* Controller for the "GUAC_TOTP_CODE" field which prompts the user to enter
* the code generated by their authentication device.
*/
angular.module('guacTOTP').controller('authenticationCodeFieldController', ['$scope',
function authenticationCodeFieldController($scope) {
angular.module('guacTOTP').controller('authenticationCodeFieldController', ['$scope', '$window',
function authenticationCodeFieldController($scope, $window) {
/**
* The secret key split into groups of at most four characters each, or
@@ -56,4 +56,13 @@ angular.module('guacTOTP').controller('authenticationCodeFieldController', ['$sc
$scope.detailsShown = false;
};
/**
* Attempts to open the "otpauth" URI containing the user's TOTP key,
* invoking whichever application may be installed locally for handling
* multi-factor authentication.
*/
$scope.openKeyURI = function openKeyURI() {
$window.open($scope.field.keyUri);
};
}]);