On Tuesday, November 10, 2020, 10:49:47 AM GMT+1, Mike Jumper
<[email protected]> wrote:
>> Is there a way to get the authenticated username in any of these custom
>>pages?
>> Something like ${GUAC_USERNAME} in a custom .html file?
>
> Yes, by invoking authenticationService.getCurrentUsername():
>
> https://github.com/apache/guacamole-client/blob/43f8cc0400266288a70448ad7ddc12b10734c83f/guacamole/src/main/webapp/app/auth/service/authenticationService.js#L317-L335
>
> To do that from within a template that you've patched, you would need to
> create an AngularJS directive that handles invoking that function and
> rendering the result.
So it's not as simple as writing this in my custom HTML file, is it?
<div ng-app=""
ng-init="test='test';name=authenticationService.getCurrentUsername()">
<p>Test: <input type="text" ng-model="test"></p>
<p>Echo Test: {{ test }}</p>
<p>Name: <input type="text" ng-model="name"></p>
<p>Echo Name: {{ name }}</p>
</div>
The 'test' variable works, the 'name' variable however doesn't. I'm a rookie in
this domain so any suggestions/tips are greatly appreciated.
Thanks,
Vieri
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]