Skip to content

Conversation

iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Sep 10, 2025

Description

Fixes #18220

Observes the current-user config for the 'keepUserLoggedIn' value and tries to refresh the token when the worker attempts to log out the user

Session Timeout Logic Improvements:

  • The UmbAuthSessionTimeoutController now observes the user's "keepUserLoggedIn" configuration and, if enabled, will attempt to validate the token instead of logging the user out when the session times out. [1] [2]

Integration with User Configuration:

  • Added UmbCurrentUserConfigRepository to the session timeout controller to access and observe the user's configuration, specifically the "keepUserLoggedIn" setting. [1] [2]
  • Exported the user config repository from the user package, making it available for use in other parts of the application.

…e and simply try to refresh the token when the worker makes an attempt to log out the user
Copilot

This comment was marked as outdated.

… the 'current-user' package

previously, it was not exported, so is not a breaking change
…ackage to avoid circular dependencies (and because it naturally belongs there)
@iOvergaard iOvergaard removed the request for review from leekelleher September 10, 2025 15:21
@iOvergaard
Copy link
Contributor Author

On the get-go, this does not quite work because we are not allowed to import from a package module (current-user) into a core module (auth).
We will have to find a new place for the "keepUserLoggedIn" config.

…-user' package to avoid circular dependencies (and because it naturally belongs there)"

This reverts commit 17bebfb.
…ncies to the 'current-user' package"

This reverts commit 0c11462.
@iOvergaard iOvergaard requested a review from Copilot September 10, 2025 15:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #18220 by implementing proper support for the "keepUserLoggedIn" user configuration setting. When this setting is enabled, the system will attempt to validate/refresh the authentication token instead of logging the user out when the session times out.

  • Adds token validation functionality to the auth session timeout controller
  • Integrates user configuration observation to respect the "keepUserLoggedIn" setting
  • Implements early return logic to prevent logout when keepUserLoggedIn is enabled
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/src/packages/core/auth/controllers/auth-session-timeout.controller.ts:1

  • The method #tryValidateToken() is called on line 34 but is not defined in this class. This will result in a runtime error when keepUserLoggedIn is enabled and the session times out.
import type { UmbAuthFlow } from '../auth-flow.js';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeepUserLoggedIn is not working
1 participant