From 0fcb165b294563e7443049e63793241595fbdada Mon Sep 17 00:00:00 2001 From: s-tyshchenko Date: Wed, 2 Mar 2022 19:33:09 +0200 Subject: [PATCH] Microsoft Auth Remember me checkbox fix (#5578) * Update humhub.user.login.js * Update CHANGELOG_DEV.md * Update CHANGELOG_DEV.md Co-authored-by: Lucas Bartholemy --- CHANGELOG_DEV.md | 1 + .../humhub/modules/user/resources/js/humhub.user.login.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG_DEV.md b/CHANGELOG_DEV.md index 99bbea2322..62392b524a 100644 --- a/CHANGELOG_DEV.md +++ b/CHANGELOG_DEV.md @@ -38,3 +38,4 @@ - Enh #4823: Removed CHTML and CActiveForm classes as well as usages (plus refactoring) - Fix #5449: File - Update info after `setStoredFileContent` and `setStoredFile` - Enh #5127: LDAP: Reset mapping for single user only +- Fix #5578: Improved `rememberMe` parameter handling for thirdparty auth provider diff --git a/protected/humhub/modules/user/resources/js/humhub.user.login.js b/protected/humhub/modules/user/resources/js/humhub.user.login.js index fa18a6ee8c..5a61d65dde 100644 --- a/protected/humhub/modules/user/resources/js/humhub.user.login.js +++ b/protected/humhub/modules/user/resources/js/humhub.user.login.js @@ -11,7 +11,12 @@ humhub.module('user.login', function (module, require, $) { $this.data('originalUrl', original); } - $this.attr('href', checked ? original + '&rememberMe=1' : original); + var url = new URL(original, window.location.origin); + if(checked) { + url.searchParams.set('rememberMe', 1); + } + + $this.attr('href', url.toString()); }); };