Skip to content

feat(apple): Allow user-configurable account slug - #9119

Merged
thomaseizinger merged 6 commits into
mainfrom
feat/account-slug
May 14, 2025
Merged

thomaseizinger merged 6 commits into
mainfrom
feat/account-slug

Conversation

@jamilbk

@jamilbk jamilbk commented May 13, 2025 •

Copy link
Copy Markdown
Member

Now that configuration is persisted in a more reasonable fashion, we can expose a new General section to the Settings, allowing the user to configure an account slug.

This field will automatically be populated upon the first sign in, so that subsequent sign-ins will take the user directly to the account sign in page.

Fixes #5119
Related #8919

@vercel

vercel Bot commented May 13, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firezone ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2025 0:22am

@jamilbk
jamilbk marked this pull request as ready for review May 13, 2025 18:02
Copilot AI review requested due to automatic review settings May 13, 2025 18:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new user-configurable “account slug” field across settings persistence, validation, and UI.

  • Introduces accountSlug in the view model with validation hooks and integrates it into apply/reset logic.
  • Persists the slug in the store during sign-in and exposes it in the WebAuthSession URL.
  • Adds a new “General” tab to the Settings UI on both iOS and macOS for editing the slug.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
SettingsViewModel.swift Added accountSlug property, validation methods, state logic
SettingsView.swift New “General” tab with account slug fields and UI adjustments
Store.swift Persists accountSlug during sign-in
WebAuthSession.swift Appends slug to the auth URL used for web authentication
Comments suppressed due to low confidence (1)

swift/apple/FirezoneKit/Sources/FirezoneKit/Views/SettingsViewModel.swift:152

  • The new isAccountSlugValid method and slug persistence paths lack unit tests. Add tests to cover valid and invalid slug inputs and persistence behavior.
return true

….swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>

@thomaseizinger thomaseizinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice work! This is a small but good UX improvement. Excited to ship this on all clients.

I think this deserves a changelog entry.


// This will save the account slug even if overridden from MDM. This is what we want - if the admin removes the
// override, this will take effect again.
try await setAccountSlug(authResponse.accountSlug)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So this effectively saves the last used one, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah. In most cases a nice little UX bump for nearly all users.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For MSPs though, it could be a step backwards. Will tackle that later.

@jamilbk
jamilbk enabled auto-merge May 13, 2025 23:41
@jamilbk
jamilbk added this pull request to the merge queue May 13, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch May 14, 2025
@jamilbk
jamilbk added this pull request to the merge queue May 14, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 14, 2025
github-merge-queue Bot pushed a commit that referenced this pull request May 14, 2025
Appends the account slug to the admin portal URL when opened.

Related: #4505 
Related: #9119
@jamilbk
jamilbk added this pull request to the merge queue May 14, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 14, 2025
@thomaseizinger
thomaseizinger added this pull request to the merge queue May 14, 2025
Merged via the queue into main with commit f19702f May 14, 2025
@thomaseizinger
thomaseizinger deleted the feat/account-slug branch May 14, 2025 04:31

This branch was successfully deployed

1 active deployment
Preview — fd0cf277 Deployed May 14, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a new General section to Settings

3 participants