From 633d30ee8db67bebd9f5c1cd6bc30d92b51a74c1 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 9 Apr 2024 17:04:03 +0200 Subject: [PATCH] auth-react: completely remove path option Signed-off-by: Patrik Oldsberg --- .changeset/fifty-cameras-shake.md | 6 ++++-- plugins/auth-react/api-report.md | 1 - .../CookieAuthRefreshProvider/CookieAuthRefreshProvider.tsx | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.changeset/fifty-cameras-shake.md b/.changeset/fifty-cameras-shake.md index b87d4e92c2..2ba4d9e277 100644 --- a/.changeset/fifty-cameras-shake.md +++ b/.changeset/fifty-cameras-shake.md @@ -1,5 +1,7 @@ --- -'@backstage/plugin-auth-react': patch +'@backstage/plugin-auth-react': minor --- -Update the default cookie base path and create a experimental redirect to root and app mode components, the components authenticate and keep a cookie refresh loop on the client side. +**BREAKING**: Removed the path option from `CookieAuthRefreshProvider` and `useCookieAuthRefresh`. + +A new `CookieAuthRedirect` component has been added to redirect a public app bundle to the protected one when using the `app-backend` with a separate public entry point. diff --git a/plugins/auth-react/api-report.md b/plugins/auth-react/api-report.md index f9c8a10123..d5206261d2 100644 --- a/plugins/auth-react/api-report.md +++ b/plugins/auth-react/api-report.md @@ -17,7 +17,6 @@ export function CookieAuthRefreshProvider( // @public export type CookieAuthRefreshProviderProps = { pluginId: string; - path?: string; children: ReactNode; }; diff --git a/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.tsx b/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.tsx index b22dce474a..307898dbea 100644 --- a/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.tsx +++ b/plugins/auth-react/src/components/CookieAuthRefreshProvider/CookieAuthRefreshProvider.tsx @@ -27,8 +27,6 @@ import { useCookieAuthRefresh } from '../../hooks'; export type CookieAuthRefreshProviderProps = { // The plugin ID used for discovering the API origin pluginId: string; - // The path used for calling the refresh cookie endpoint, default to '/.backstage/auth/v1/cookie' - path?: string; // The children to render when the refresh is successful children: ReactNode; };