From 2e162e1008f7c5f6c11c738136ea10a9726f5f11 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 10 Nov 2023 14:50:16 -0600 Subject: [PATCH] Add the location to the restriction Fixes #1671 --- .../src/controllers/auth_restriction_controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/src/controllers/auth_restriction_controller.js b/app/javascript/src/controllers/auth_restriction_controller.js index 27e2a9f79..18ea8f8da 100644 --- a/app/javascript/src/controllers/auth_restriction_controller.js +++ b/app/javascript/src/controllers/auth_restriction_controller.js @@ -16,7 +16,7 @@ export default class extends Controller { } else if (status.includes('stanford_restricted')) { this.displayStanfordRestriction(authResponse.service) } else if (status.includes('location_restricted')) { - this.displayLocationRestriction(authResponse.service) + this.displayLocationRestriction(authResponse.location) } } @@ -30,7 +30,8 @@ export default class extends Controller { this.stanfordRestrictionTarget.hidden = false } - displayLocationRestriction(_loginService) { + displayLocationRestriction(restrictionLocation) { + this.locationRestrictionTarget.querySelector('.loginMessage').innerText = `Access is restricted to the ${restrictionLocation.label}. See Access conditions for more information.` this.locationRestrictionTarget.hidden = false }