From fec31bdde5b0d552eefd89d4ac079bb08abae942 Mon Sep 17 00:00:00 2001 From: Jonathan Roebuck Date: Tue, 31 Mar 2026 13:31:23 +0100 Subject: [PATCH] feat(auth-node): add OAuthAuthenticatorLogoutResult type for provider logout redirects Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Jonathan Roebuck --- plugins/auth-node/src/oauth/index.ts | 1 + plugins/auth-node/src/oauth/types.ts | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/auth-node/src/oauth/index.ts b/plugins/auth-node/src/oauth/index.ts index 9cff6c5358..afc6faa27e 100644 --- a/plugins/auth-node/src/oauth/index.ts +++ b/plugins/auth-node/src/oauth/index.ts @@ -37,6 +37,7 @@ export { type OAuthAuthenticator, type OAuthAuthenticatorAuthenticateInput, type OAuthAuthenticatorLogoutInput, + type OAuthAuthenticatorLogoutResult, type OAuthAuthenticatorRefreshInput, type OAuthAuthenticatorResult, type OAuthAuthenticatorScopeOptions, diff --git a/plugins/auth-node/src/oauth/types.ts b/plugins/auth-node/src/oauth/types.ts index 50d81f99dc..968ffac39e 100644 --- a/plugins/auth-node/src/oauth/types.ts +++ b/plugins/auth-node/src/oauth/types.ts @@ -76,6 +76,16 @@ export interface OAuthAuthenticatorLogoutInput { req: Request; } +/** @public */ +export interface OAuthAuthenticatorLogoutResult { + /** + * If set, the frontend will redirect the browser to this URL after clearing + * the Backstage session. Use this to terminate provider-side sessions (e.g. + * Auth0's `/v2/logout` endpoint). + */ + logoutUrl?: string; +} + /** @public */ export interface OAuthAuthenticatorResult { fullProfile: TProfile; @@ -101,7 +111,10 @@ export interface OAuthAuthenticator { input: OAuthAuthenticatorRefreshInput, ctx: TContext, ): Promise>; - logout?(input: OAuthAuthenticatorLogoutInput, ctx: TContext): Promise; + logout?( + input: OAuthAuthenticatorLogoutInput, + ctx: TContext, + ): Promise; } /** @public */