I often use the Credential Viewer app to troubleshoot and resolve various issues. However, I have always wondered why this app does not include a logout button.
Using a Lua module, I was able to solve this by creating an LUA HTTP transformation that injects a logout button into the response.
Here is the code I used:
local body = HTTPResponse.getBody()
local modified_body = body:gsub(
"Credential Viewer</h1>",
'Credential Viewer</h1><a href="/pkmslogout"><button>Logout</button></a>',
1
)
HTTPResponse.setBody(modified_body)
After that, I configured the instance to execute this Lua script using the following settings:
insert-logout-in-creds = InsertLogoutCreds.lua
[http-transformations:insert-logout-in-creds]
request-match = response:GET /creds*
With this configuration, the logout button is automatically added to the Credential Viewer page, making it easier and safer to end sessions when needed.
------------------------------
Rudy Santos
------------------------------