Adds saving multiple app regs for login. Closes #183 - #854
Draft
Adam-it wants to merge 1 commit into
Draft
Conversation
nicodecleyre
requested changes
Aug 11, 2026
nicodecleyre
left a comment
Contributor
There was a problem hiding this comment.
Great work so far! Can you take a look at the comment i left? And as you said, let's make the documentation before going for that final review 😉👍
Comment on lines
+59
to
+66
| public static getLastUsed(context: ExtensionContext): AppRegistration | undefined { | ||
| const clientId = context.globalState.get<string>(LAST_USED_KEY); | ||
| if (!clientId) { | ||
| return undefined; | ||
| } | ||
|
|
||
| return AppRegistrations.getAll().find(item => item.clientId.toLowerCase() === clientId.toLowerCase()); | ||
| } |
Contributor
There was a problem hiding this comment.
setLastUsed stores only clientId and getLastUsed matches only on that. Elsewhere (isSame), a registration is unique on clientId & tenantId. I would suggest to store tenantId in LAST_USED_KEY (as a JSON object) and match on the pair, so that this is consistent with the rest of the class.
nicodecleyre
marked this pull request as draft
August 11, 2026 21:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Aim
The aim of this PR is to allow setting up multiple app regs for multiple tenants and save them in the extension settings. Then, when signing in, the user may pick the app reg by its friendly name from the list of saved app regs. It is also possible to delete one of the saved app regs. The PR does include a migration flow of the existing app reg the user might already have.
📷 Result
Saving app reg friendly name when creating a new app reg

The app reg name is visible in te view

new setting only editable directly in JSON settings mode


Deleting one of the saved app regs

✅ What was done
🔗 Related issue
Closes #183