From de3a1f5ec6c7809f83b424d3f78c7420d608cb34 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 4 Apr 2023 09:10:13 -0700 Subject: [PATCH] GUACAMOLE-839: Omit properties added by AngularJS core from auth request parameters. --- .../frontend/src/app/auth/service/authenticationService.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js b/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js index 88143a740..af5a9ab6c 100644 --- a/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js +++ b/guacamole/src/main/frontend/src/app/auth/service/authenticationService.js @@ -196,6 +196,13 @@ angular.module('auth').factory('authenticationService', ['$injector', // Attempt authentication after auth parameters are available ... return parameters.then(function requestParametersReady(requestParams) { + // Strip any properties that are from AngularJS core, such as the + // '$$state' property added by $q. Properties added by AngularJS + // core will have a '$' prefix. The '$$state' property is + // particularly problematic, as it is self-referential and explodes + // the stack when fed to $.param(). + requestParams = _.omitBy(requestParams, (value, key) => key.startsWith('$')); + return requestService({ method: 'POST', url: 'api/tokens',