Self-hosted desktop SSO (#5265)

# Description of Changes
Support SSO in self-hosted desktop app.

---------

Co-authored-by: Anthony Stirling <[email protected]>
This commit is contained in:
James Brunton
2026-01-09 18:21:16 +00:00
committed by GitHub
co-authored by Anthony Stirling
parent dd09f7b7cf
commit 18be8f4692
40 changed files with 1877 additions and 135 deletions
@@ -0,0 +1,20 @@
type SignOutFn = () => Promise<void>;
interface AccountLogoutDeps {
signOut: SignOutFn;
redirectToLogin: () => void;
}
/**
* Default (web/proprietary) logout handler: sign out and redirect to /login.
* Desktop builds override this file via path resolution.
*/
export function useAccountLogout() {
return async ({ signOut, redirectToLogin }: AccountLogoutDeps): Promise<void> => {
try {
await signOut();
} finally {
redirectToLogin();
}
};
}
@@ -0,0 +1,7 @@
/**
* Extension hook for platform-specific OAuth callback handling.
* Proprietary/web builds are no-op.
*/
export async function handleAuthCallbackSuccess(_token: string): Promise<void> {
// no-op for web builds
}
@@ -0,0 +1,11 @@
/**
* Extension hooks for platform-specific auth cleanup.
* Proprietary/web builds are no-op.
*/
export async function clearPlatformAuthAfterSignOut(): Promise<void> {
// no-op for web builds
}
export async function clearPlatformAuthOnLoginInit(): Promise<void> {
// no-op for web builds
}
@@ -0,0 +1,7 @@
/**
* Extension hook for platform-specific OAuth navigation.
* Proprietary/web builds default to in-window navigation.
*/
export async function startOAuthNavigation(_redirectUrl: string): Promise<boolean> {
return false;
}