From f82952433fdb8e98eaa943a6ccc173a92e8f39e8 Mon Sep 17 00:00:00 2001 From: Stephen Glass Date: Tue, 13 Aug 2024 23:52:51 -0400 Subject: [PATCH] update changeset Signed-off-by: Stephen Glass --- .changeset/violet-beds-promise.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.changeset/violet-beds-promise.md b/.changeset/violet-beds-promise.md index ea5f478543..5fd4890ffa 100644 --- a/.changeset/violet-beds-promise.md +++ b/.changeset/violet-beds-promise.md @@ -1,17 +1,14 @@ --- '@backstage/core-components': patch -'@backstage/core-plugin-api': patch -'@backstage/app-defaults': patch -'@backstage/core-app-api': patch '@backstage/plugin-auth-backend': patch '@backstage/plugin-auth-node': patch +'@backstage/plugin-auth-react': patch --- -Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `AuthErrorApi`. Example: +Fix error handling using authentication redirect flow via `enableExperimentalRedirectFlow` config. If an error is caught during authentication, the user is redirected back to app origin with `?error=true` query parameter. A cookie is also set in the redirect which contains the error message. The error can be fetched from any custom sign in page using the new `useSignInAuthError` hook.: ```ts -import { useApi, authErrorApiRef } from '@backstage/core-plugin-api'; +import { useSignInAuthError } from '@backstage/plugin-auth-react'; -const authErrorApi = useApi(authErrorApiRef); -const errorResponse = await authErrorApi.getSignInAuthError(); +const { error, checkAuthError } = useSignInAuthError(); ```