[java-idp-plugin-totp] branch main updated: JTOTP-16 - Add auto-focus to token code field in form

Scott Cantor cantor.2 at osu.edu
Wed Apr 2 13:07:43 UTC 2025


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-idp-plugin-totp.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-totp.git;a=commit;h=683be7a3c5d6bed5166d927b4cea12b4cd950521

The following commit(s) were added to refs/heads/main by this push:
     new 683be7a  JTOTP-16 - Add auto-focus to token code field in form
683be7a is described below

commit 683be7a3c5d6bed5166d927b4cea12b4cd950521
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Apr 2 09:07:40 2025 -0400

    JTOTP-16 - Add auto-focus to token code field in form
    
    https://shibboleth.atlassian.net/browse/JTOTP-16
---
 .../resources/net/shibboleth/idp/plugin/authn/totp/views/totp.vm     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/totp-impl/src/main/resources/net/shibboleth/idp/plugin/authn/totp/views/totp.vm b/totp-impl/src/main/resources/net/shibboleth/idp/plugin/authn/totp/views/totp.vm
index 7f3151b..2c0626b 100644
--- a/totp-impl/src/main/resources/net/shibboleth/idp/plugin/authn/totp/views/totp.vm
+++ b/totp-impl/src/main/resources/net/shibboleth/idp/plugin/authn/totp/views/totp.vm
@@ -21,7 +21,8 @@
 #set ($rpContext = $profileRequestContext.getSubcontext('net.shibboleth.profile.context.RelyingPartyContext'))
 ##
 #set ($onClick = "this.childNodes[0].nodeValue='#springMessageText('idp.login.pleasewait', 'Logging in, please wait...')'")
-$response.addHeader("Content-Security-Policy", "script-src-attr 'unsafe-hashes' 'sha256-$cspDigester.apply($onClick)'")
+#set ($onLoad = "document.getElementById('tokencode').focus()")
+$response.addHeader("Content-Security-Policy", "script-src-attr 'unsafe-hashes' 'sha256-$cspDigester.apply($onLoad)' 'sha256-$cspDigester.apply($onClick)'")
 <!DOCTYPE html>
 <html>
     <head>
@@ -31,7 +32,7 @@ $response.addHeader("Content-Security-Policy", "script-src-attr 'unsafe-hashes'
         <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
         <link rel="stylesheet" type="text/css" href="$request.getContextPath()#springMessageText("idp.css", "/css/placeholder.css")">
     </head>
-    <body>
+    <body onLoad="$onLoad">
         <main class="main">
             <header>
                 <img class="main-logo" src="$request.getContextPath()#springMessageText("idp.logo", "/images/placeholder-logo.png")" alt="#springMessageText("idp.logo.alt-text", "logo")" />

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list