Skip to main content
Urbicon UI
source

SessionManagerbeta

Lists the user's active sessions, one row per signed-in device with a device label, last-active time and a 'this device' badge, and lets them sign out one session or all other devices. Requires refresh-token rotation on the server.

01 Usage

Basic

The live preview runs against a mocked demo API (injected via the fetcher prop): signing a session out updates the list. The snippet shows the production setup. Needs config.refreshToken rotation on the server; without it the list renders an unavailable message instead.

Active sessions

Loading...
<script lang="ts">
  import { SessionManager } from '@urbicon-ui/auth';
</script>

<SessionManager apiPath="/api/auth/sessions" />

02 Accessibility

Sessions are a list

The devices render as a <ul> of <li>, so a screen reader announces how many sessions exist before reading them and the user can jump between them with list navigation.

The current device is marked with a word

The current session carries a Badge with localized text, not colour alone, so the session you are sitting at stays distinguishable from the ones you might revoke for a reader who cannot rely on colour.

Only the row you acted on goes busy

During a revoke, only that row's button carries loading and disabled, so the rest of the list stays operable and blocks' Button exposes aria-busy on the row that is actually working.

Every sign-out button names its device

The visible text is just "Sign out", but each button carries an aria-label with the row's device description appended — "Sign out — Chrome · macOS". A reader tabbing the list hears which session each button ends instead of several identically named buttons, and because the name still begins with the visible word, voice control ("click Sign out") keeps working. The device string is the same heuristic the row shows, so an unrecognised user agent names the button "Sign out — Unknown device" rather than inventing one.

03 API Reference

8 props
Prop
Type
Default
Description

04 Types

Local type definitions used by this component.

5 types
Name
Kind
Category
Used by
Description

05 Installation

Import

import { SessionManager } from '@urbicon-ui/auth';