Skip to content

Commit

Permalink
button toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmweisz committed Dec 17, 2024
1 parent be02ebe commit b13c0fc
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 24 deletions.
2 changes: 2 additions & 0 deletions src/SPConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export default class SPConfig {
this.failureFlash = true;
this.category = argv.category || "id_me";
this.signupLinkEnabled = argv.spIdpSignupLinkEnabled;
this.dsLogonEnabled = argv.dsLogonEnabled ?? true;
this.mhvLogonEnabled = argv.mhvLogonEnabled ?? true;
}

getMetadataParams(req) {
Expand Down
12 changes: 12 additions & 0 deletions src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,18 @@ export function processArgs() {
boolean: true,
default: false,
},
dsLogonEnabled: {
description: "Enables DS Logon signin option, enabled by default",
required: false,
boolean: true,
default: true,
},
mhvLogonEnabled: {
description: "Enables MHV Logon signin option, enabled by default",
required: false,
boolean: true,
default: true,
},
},
})
.example(
Expand Down
22 changes: 22 additions & 0 deletions src/routes/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export const samlLogin = function (template) {
});
}, Promise.resolve({}))
.then((authOptions) => {
authOptions.mhv_logon_enabled = isMhvLogonEnabled(req);
authOptions.ds_logon_enabled = isDsLogonEnabled(req);
authOptions.body = template;
authOptions.login_gov_enabled = login_gov_enabled;
authOptions.login_gov_signup_link_enabled =
Expand Down Expand Up @@ -199,3 +201,23 @@ function enabled_logingov(req) {
}
return false;
}

/**
* Is MHV enabled?
*
* @param {*} req service provider request
* @returns {*} boolean
*/
function isMhvLogonEnabled(req) {
return !!req.sps.options.id_me.mhvLogonEnabled;
}

/**
* Is DS Logon enabled?
*
* @param {*} req service provider request
* @returns {*} boolean
*/
function isDsLogonEnabled(req) {
return !!req.sps.options.id_me.dsLogonEnabled;
}
54 changes: 30 additions & 24 deletions views/login_selection.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,36 @@
<a href="https://www.va.gov/resources/creating-an-account-for-vagov">
Learn more about creating a Login.gov or ID.me account
</a>
<h2 style="margin: 45px 0 15px;">Other ways to verify</h2>
<h3 style="margin: 0 0 10px;">
My HealtheVet
<span class="vads-u-display--block vads-u-font-size--md vads-u-font-family--sans">
Available through January 31, 2025
</span>
</h3>
<p style="margin: 0 0 16.96px;">
You’ll still be able to use <strong>My HealtheVet</strong> after this date.
You’ll just need to verify yourself with <strong>Login.gov</strong> or <strong>ID.me</strong>.
</p>
<a class="usa-button mhv-signin vads-u-margin-y--1p5 vads-u-padding-y--2" href="<%- mhv_login_link -%>">
My HealtheVet
</a>
<h3 class="vads-u-margin-bottom--0 vads-u-margin-top--3">
DS Logon
<span class="vads-u-display--block vads-u-font-size--base vads-u-font-family--sans">
Available through September 30, 2025
</span>
</h3>
<p style="margin: 16.96px 0;">
You’ll still be able to use <strong>DS Logon</strong> for Defense Department websites after this date.
</p>
<a class="usa-button dslogon-signin vads-u-margin-y--1p5 vads-u-padding-y--2" href="<%- dslogon_login_link -%>">DS Logon</a>
<% if (ds_logon_enabled || mhv_logon_enabled) { %>
<h2 style="margin: 45px 0 15px;">Other ways to verify</h2>
<% } %>
<% if (mhv_logon_enabled) { %>
<h3 style="margin: 0 0 10px;">
My HealtheVet
<span class="vads-u-display--block vads-u-font-size--md vads-u-font-family--sans">
Available through January 31, 2025
</span>
</h3>
<p style="margin: 0 0 16.96px;">
You’ll still be able to use <strong>My HealtheVet</strong> after this date.
You’ll just need to verify yourself with <strong>Login.gov</strong> or <strong>ID.me</strong>.
</p>
<a class="usa-button mhv-signin vads-u-margin-y--1p5 vads-u-padding-y--2" href="<%- mhv_login_link -%>">
My HealtheVet
</a>
<% } %>
<% if (ds_logon_enabled) { %>
<h3 class="vads-u-margin-bottom--0 vads-u-margin-top--3">
DS Logon
<span class="vads-u-display--block vads-u-font-size--base vads-u-font-family--sans">
Available through September 30, 2025
</span>
</h3>
<p style="margin: 16.96px 0;">
You’ll still be able to use <strong>DS Logon</strong> for Defense Department websites after this date.
</p>
<a class="usa-button dslogon-signin vads-u-margin-y--1p5 vads-u-padding-y--2" href="<%- dslogon_login_link -%>">DS Logon</a>
<% } %>
</div>
</div>
</div>
Expand Down

0 comments on commit b13c0fc

Please sign in to comment.