Skip to content

Allow setting custom names on sessions #4459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 30, 2025
Merged

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Apr 25, 2025

This can be reviewed commit by commit.

This does a few things:

  • on the compat /login API, it gathers the initial_device_display_name and sets it as the session human_name
  • that human_name is transmitted to the homeserver when creating the device
  • similarly, we now compute a initial device name for OAuth 2.0 sessions, which usually looks like Element on Safari for macOS
  • to be able to do that, we now track the locale the browser had when we started the authorisation code grant
  • it also introduces the custom human_name on oauth2 sessions
  • those human_name are shown on the frontend (& GraphQL & admin API)
  • and there is an edit button on the frontend to set a custom name for the session

Notable omissions:

  • we don't compute a session name for device code grants. We'd also need to track the locale to do that
  • we don't update the device display name on device list sync. They can very much get out of sync, especially if the device name gets updated in the client, which is likely fine

Fixes #2366
Related to #3919

@sandhose sandhose requested a review from reivilibre April 25, 2025 13:42
@sandhose sandhose added A-Device-Management Related to sessions and device management T-Enhancement New feature of request labels Apr 25, 2025
@sandhose sandhose force-pushed the quenting/custom-device-name branch from b59254c to 2df3602 Compare April 25, 2025 14:41
Copy link

cloudflare-workers-and-pages bot commented Apr 25, 2025

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4f9e75c
Status: ✅  Deploy successful!
Preview URL: https://46b1b6b7.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-custom-device-name.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose force-pushed the quenting/custom-device-name branch from 2df3602 to 4f9e75c Compare April 25, 2025 14:55
@sandhose sandhose merged commit 8bfe2d2 into main Apr 30, 2025
21 checks passed
@sandhose sandhose deleted the quenting/custom-device-name branch April 30, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Device-Management Related to sessions and device management T-Enhancement New feature of request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Presentation of devices / session confusing and inconsistent across clients
1 participant