diff --git a/src/open_inwoner/accounts/tests/test_auth.py b/src/open_inwoner/accounts/tests/test_auth.py index 5c60b5213c..54a2c719e1 100644 --- a/src/open_inwoner/accounts/tests/test_auth.py +++ b/src/open_inwoner/accounts/tests/test_auth.py @@ -1253,7 +1253,7 @@ def test_logout(self): """Test that a user is able to log out and page redirects to root endpoint.""" # Log out user and redirection logout_response = self.app.get(reverse("logout"), user=self.user) - self.assertRedirects(logout_response, reverse("pages-root")) + self.assertRedirects(logout_response, reverse("login")) self.assertFalse(logout_response.follow().context["user"].is_authenticated) diff --git a/src/open_inwoner/accounts/tests/test_profile_views.py b/src/open_inwoner/accounts/tests/test_profile_views.py index 3fb46c4305..614626fef1 100644 --- a/src/open_inwoner/accounts/tests/test_profile_views.py +++ b/src/open_inwoner/accounts/tests/test_profile_views.py @@ -529,7 +529,7 @@ def test_delete_regular_user_success(self): # check redirect self.assertRedirects( self.app.get(response.url), - reverse("pages-root"), + reverse("login"), status_code=302, target_status_code=200, fetch_redirect_response=True, @@ -548,7 +548,7 @@ def test_delete_user_with_digid_login_success(self): # check redirect self.assertRedirects( self.app.get(response.url), - reverse("pages-root"), + reverse("login"), status_code=302, target_status_code=200, fetch_redirect_response=True, diff --git a/src/open_inwoner/conf/base.py b/src/open_inwoner/conf/base.py index cd4bea2be6..8916909394 100644 --- a/src/open_inwoner/conf/base.py +++ b/src/open_inwoner/conf/base.py @@ -478,10 +478,10 @@ "ADMIN_SESSION_COOKIE_AGE", 3600 ) # Default 1 hour max session duration for admins SESSION_WARN_DELTA = 60 # Warn 1 minute before end of session. -SESSION_COOKIE_AGE = 900 # Set to 15 minutes +SESSION_COOKIE_AGE = 900 # Set to 15 minutes or less for testing LOGIN_REDIRECT_URL = "/" -LOGOUT_REDIRECT_URL = "/" +LOGOUT_REDIRECT_URL = "/accounts/login/" # # SECURITY settings diff --git a/src/open_inwoner/js/components/modal/index.js b/src/open_inwoner/js/components/modal/index.js index 1e18ab66a2..98c57c273a 100644 --- a/src/open_inwoner/js/components/modal/index.js +++ b/src/open_inwoner/js/components/modal/index.js @@ -30,14 +30,8 @@ export default class Modal { } setListeners() { - this.node.addEventListener('click', (event) => { - event.preventDefault() - this.hide() - }) - this.close.addEventListener('click', (event) => { event.preventDefault() - this.hide() }) diff --git a/src/open_inwoner/js/components/session/index.js b/src/open_inwoner/js/components/session/index.js index a2ca7471da..8e7ee3f7ab 100644 --- a/src/open_inwoner/js/components/session/index.js +++ b/src/open_inwoner/js/components/session/index.js @@ -33,17 +33,17 @@ class SessionTimeout { this.warnTime * 1000 ) this.expiredTimeout = setTimeout( - this.showExpiredModal, + this.showExpiredModal.bind(this), (this.expiryAge + 1) * 1000 ) } setDataset() { - console.log('setDataset') this.expiryAge = parseInt(this.element.dataset.expiryAge) this.warnTime = parseInt(this.element.dataset.warnTime) - console.log('this.expiryAge', this.expiryAge) - console.log('this.warnTime', this.warnTime) + console.log('this.expiryAge is: ', this.expiryAge) + console.log('this.warnTime is: ', this.warnTime) + console.log('Expire modal opens after: ', this.expiryAge + 1) } showWarningModal() { @@ -113,6 +113,7 @@ class SessionTimeout { this.restartNoActivity.bind(this), 30 * 1000 ) + // SESSION_COOKIE_AGE in seconds - (minus) 30 = warnTime } restartNoActivity() {