[js-embedded-discovery] branch main updated: EDS-98 Skip auto-follow on quick repeat visit
Codeberg
noreply at shibboleth.net
Mon Apr 20 12:40:04 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository js-embedded-discovery.
View the commit online:
https://codeberg.org/Shibboleth/js-embedded-discovery/commit/8d3fa00d00a1ca70e157ea7f24b10ee5e4af2a9a
The following commit(s) were added to refs/heads/main by this push:
new 8d3fa00 EDS-98 Skip auto-follow on quick repeat visit
8d3fa00 is described below
commit 8d3fa00d00a1ca70e157ea7f24b10ee5e4af2a9a
Author: Ian Bobbitt <ibobbitt at globalnoc.iu.edu>
AuthorDate: Mon Mar 30 15:37:01 2026 -0400
EDS-98 Skip auto-follow on quick repeat visit
License: Apache License Version 2.0
Signed-off-by: Ian Bobbitt <ibobbitt at globalnoc.iu.edu>
---
src/javascript/idpselect.js | 29 +++++++++++++++++++++++++++++
src/javascript/idpselect_config.js | 2 ++
2 files changed, 31 insertions(+)
diff --git a/src/javascript/idpselect.js b/src/javascript/idpselect.js
index f588b0f..bf039ab 100644
--- a/src/javascript/idpselect.js
+++ b/src/javascript/idpselect.js
@@ -43,6 +43,8 @@ function IdPSelectUI() {
var autoFollowCookie;
var autoFollowCookieTTLs;
var autoFollowCookieProps;
+ var autoFollowRepeatAttemptWindow;
+ var autoFollowRepeatAttemptCookie;
//
// The cookie contents
@@ -96,6 +98,15 @@ function IdPSelectUI() {
return;
}
+ //
+ // Clear auto-dispatch on quick repeat visit
+ //
+ if (autoFollowRepeatAttemptWindow > 0 &&
+ null != autoFollowRepeatAttemptCookie &&
+ setRepeatAttemptCookie()) {
+ setAutoDispatchCookie(0);
+ }
+
//
// Quick test for auto-dispatch
//
@@ -215,6 +226,8 @@ function IdPSelectUI() {
autoFollowCookie = paramsSupplied.autoFollowCookie;
autoFollowCookieTTLs = paramsSupplied.autoFollowCookieTTLs;
autoFollowCookieProps = paramsSupplied.autoFollowCookieProps;
+ autoFollowRepeatAttemptWindow = paramsSupplied.autoFollowRepeatAttemptWindow;
+ autoFollowRepeatAttemptCookie = paramsSupplied.autoFollowRepeatAttemptCookie;
var lang;
@@ -1514,6 +1527,22 @@ function IdPSelectUI() {
((autoFollowCookieProps===null) ? '' : autoFollowCookieProps);
}
+ /*
+ Set the autoFollowRepeatAttemptCookie with a life of
+ autoFollowRepeatAttemptWindow seconds.
+
+ @return (boolean) true if a repeat-attempt cookie already existed
+ */
+
+ var setRepeatAttemptCookie = function() {
+ var isRepeatAttempt = (null!=getCookieCalled(autoFollowRepeatAttemptCookie));
+ var expires = new Date();
+ expires.setSeconds(expires.getSeconds() + autoFollowRepeatAttemptWindow);
+ document.cookie = autoFollowRepeatAttemptCookie + '=1;path=/;expires=' + expires.toUTCString() +
+ ((autoFollowCookieProps===null) ? '' : autoFollowCookieProps);
+ return isRepeatAttempt;
+ }
+
/**
Gets the value of the cookie with the provided name
diff --git a/src/javascript/idpselect_config.js b/src/javascript/idpselect_config.js
index 09fecfd..9afc035 100644
--- a/src/javascript/idpselect_config.js
+++ b/src/javascript/idpselect_config.js
@@ -36,6 +36,8 @@ function IdPSelectUIParms(){
this.autoFollowCookie = null; // If you want auto-dispatch, set this to the cookie name to use
this.autoFollowCookieTTLs = [ 1, 60, 270 ]; // Cookie life (in days). Changing this requires changes to idp_select_languages
this.autoFollowCookieProps = '; Secure; SameSite=Lax'; // If set to a custom string, the string is appended to the cookie value
+ this.autoFollowRepeatAttemptCookie = null; // Cookie name used to track recent visits and suppress repeat auto-dispatch
+ this.autoFollowRepeatAttemptWindow = 0; // Time window (in seconds) used for that recent-visit check
//
// Language support.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list