Skip to content

Commit

Permalink
Merge pull request #65 from UKHomeOffice/feature/YEL-10651-theme
Browse files Browse the repository at this point in the history
Update GOVUK-Internal-DQ
  • Loading branch information
James-Royds-HO authored Oct 25, 2024
2 parents a287c29 + 64dd981 commit eda64ca
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
35 changes: 35 additions & 0 deletions govuk-internal-dq/login-config-totp.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<#import "template.ftl" as layout>
<@layout.registrationLayout displayInfo=true; section>
<#if section = "title">
${msg("loginTotpTitle")}
<#elseif section = "header">
${msg("loginTotpTitle")}
<#elseif section = "form">
<ol id="kc-totp-settings" class="list list-number">
<li>
<p>${msg("loginTotpStep1")}</p>
</li>
<li>
<p>${msg("loginTotpStep2")}</p>
<img id="kc-totp-secret-qr-code" src="data:image/png;base64, ${totp.totpSecretQrCode}" alt="Figure: Barcode"><br/>
<span class="code">${totp.totpSecretEncoded}</span>
</li>
<li>
<p>${msg("loginTotpStep3")}</p>
</li>
</ol>
<form action="${url.loginAction}" class="${properties.kcFormClass!}" id="kc-totp-settings-form" method="post">
<div class="${properties.kcFormGroupClass!}">
<div class="${properties.kcLabelWrapperClass!}">
<label for="totp" class="${properties.kcLabelClass!}">${msg("loginTotpOneTime")}</label>
</div>
<div class="${properties.kcInputWrapperClass!}">
<input type="text" id="totp" name="totp" autocomplete="off" class="${properties.kcInputClass!}" />
</div>
<input type="hidden" id="totpSecret" name="totpSecret" value="${totp.totpSecret}" />
</div>

<input class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonLargeClass!}" type="submit" value="${msg("doSubmit")}"/>
</form>
</#if>
</@layout.registrationLayout>
71 changes: 71 additions & 0 deletions govuk-internal-dq/login-otp.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<#import "template.ftl" as layout>
<@layout.registrationLayout; section>
<#if section="header">
${msg("doLogIn")}
<#elseif section="form">
<form id="kc-otp-login-form" class="${properties.kcFormClass!}" action="${url.loginAction}"
method="post">
<#if otpLogin.userOtpCredentials?size gt 1>
<div class="${properties.kcFormGroupClass!}">
<div class="${properties.kcInputWrapperClass!}">
<#list otpLogin.userOtpCredentials as otpCredential>
<div class="${properties.kcSelectOTPListClass!}">
<input type="hidden" value="${otpCredential.id}">
<div class="${properties.kcSelectOTPListItemClass!}">
<span class="${properties.kcAuthenticatorOtpCircleClass!}"></span>
<h2 class="${properties.kcSelectOTPItemHeadingClass!}">
${otpCredential.userLabel}
</h2>
</div>
</div>
</#list>
</div>
</div>
</#if>

<div class="${properties.kcFormGroupClass!}">
<div class="${properties.kcLabelWrapperClass!}">
<label for="otp" class="${properties.kcLabelClass!}">${msg("loginOtpOneTime")}</label>
</div>
<p>The one-time code is available in the FreeOTP Authenticator application, which you downloaded to your mobile phone when you set up this account</p>

<div class="${properties.kcInputWrapperClass!}">
<input id="otp" name="otp" autocomplete="off" type="text" class="${properties.kcInputClass!}"
autofocus/>
</div>
</div>

<div class="${properties.kcFormGroupClass!}">
<div id="kc-form-options" class="${properties.kcFormOptionsClass!}">
<div class="${properties.kcFormOptionsWrapperClass!}">
</div>
</div>

<div id="kc-form-buttons" class="${properties.kcFormButtonsClass!}">
<input
class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}"
name="login" id="kc-login" type="submit" value="${msg("doLogIn")}" />
</div>
</div>
</form>
<script type="text/javascript" src="${url.resourcesCommonPath}/node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Card Single Select
$('.card-pf-view-single-select').click(function() {
if ($(this).hasClass('active'))
{ $(this).removeClass('active'); $(this).children().removeAttr('name'); }
else
{ $('.card-pf-view-single-select').removeClass('active');
$('.card-pf-view-single-select').children().removeAttr('name');
$(this).addClass('active'); $(this).children().attr('name', 'selectedCredentialId'); }
});
var defaultCred = $('.card-pf-view-single-select')[0];
if (defaultCred) {
defaultCred.click();
}
});
</script>
</#if>
</@layout.registrationLayout>
10 changes: 10 additions & 0 deletions govuk-internal-dq/login/messages/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ termsText=<h2>It is an offence to continue without proper authority.</h2>\
<p>Communications using this service will also be monitored and may be recorded to secure the effective operation and for other lawful business purposes.</p>\
<p>Communications using these services will also be monitored and may be recorded to secure the effective operation and for other lawful business purposes.</p>\
<p>Unauthorised access or attempts to alter, destroy or damage data, programs or equipment could result in criminal prosecution under the Computer Misuse Act (1990)</p>
loginTotpStep1=Install the FreeOTP Authenticator app on your mobile.
loginTotpStep2=Open the app and, using the camera on your phone, scan the QR code below.
loginTotpStep3=Enter the one-time code provided by the application and click Submit to finish the setup.
<p>rovide a Device Name to help you manage your OTP devices.</p>
loginTotpOneTime=Code from FreeOTP Authenticator
emailVerifyTitle=Verify your email
emailVerifyInstruction1=An email with instructions to verify your email address has been sent to you.
emailVerifyInstruction2=If you haven''t received the verification code,
emailVerifyInstruction3=you can
emailResentClickMessage=get the email resent

0 comments on commit eda64ca

Please sign in to comment.