From dac170ec6e534643c61c3b034d2e175f6f243db4 Mon Sep 17 00:00:00 2001 From: Ankit Tiwari Date: Tue, 27 Aug 2024 21:20:04 +0530 Subject: [PATCH] feat: Add functions and prebuiltUI for oauth2 logout (#850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add functions and prebuiltUI for oauth2 logout * Update lib/ts/recipe/oauth2provider/components/themes/themeBase.tsx Co-authored-by: Mihály Lengyel * fix: PR changes * fix: PR changes --------- Co-authored-by: Mihály Lengyel --- examples/for-tests/src/OAuth2Page.js | 5 +- lib/build/components/assets/logoutIcon.d.ts | 2 + lib/build/oauth2provider-shared.js | 25 ++ lib/build/oauth2provider.js | 18 + lib/build/oauth2providerprebuiltui.js | 379 ++++++++++++++++-- .../features/oauth2LogoutScreen/index.d.ts | 11 + .../OAuth2LogoutScreenInner.d.ts | 5 + .../themes/oauth2LogoutScreen/index.d.ts | 3 + .../components/themes/themeBase.d.ts | 7 + .../components/themes/translations.d.ts | 26 +- .../recipe/oauth2provider/constants.d.ts | 1 + lib/build/recipe/oauth2provider/index.d.ts | 20 + .../recipe/oauth2provider/prebuiltui.d.ts | 35 +- lib/build/recipe/oauth2provider/types.d.ts | 47 ++- lib/ts/components/assets/logoutIcon.tsx | 27 ++ .../features/oauth2LogoutScreen/index.tsx | 130 ++++++ .../OAuth2LogoutScreenInner.tsx | 41 ++ .../themes/oauth2LogoutScreen/index.tsx | 36 ++ .../components/themes/styles.css | 31 ++ .../components/themes/themeBase.tsx | 36 ++ .../components/themes/translations.ts | 9 +- lib/ts/recipe/oauth2provider/constants.ts | 1 + .../oauth2provider/functionOverrides.ts | 9 + lib/ts/recipe/oauth2provider/index.ts | 23 ++ lib/ts/recipe/oauth2provider/prebuiltui.tsx | 57 ++- lib/ts/recipe/oauth2provider/recipe.ts | 2 + lib/ts/recipe/oauth2provider/types.ts | 57 ++- lib/ts/recipe/oauth2provider/utils.ts | 5 + stories/oauth2provider.stories.tsx | 81 ++++ test/end-to-end/oauth2provider.test.js | 63 +++ test/helpers.js | 8 +- test/unit/componentOverrides.test.tsx | 7 +- 32 files changed, 1129 insertions(+), 78 deletions(-) create mode 100644 lib/build/components/assets/logoutIcon.d.ts create mode 100644 lib/build/recipe/oauth2provider/components/features/oauth2LogoutScreen/index.d.ts create mode 100644 lib/build/recipe/oauth2provider/components/themes/oauth2LogoutScreen/OAuth2LogoutScreenInner.d.ts create mode 100644 lib/build/recipe/oauth2provider/components/themes/oauth2LogoutScreen/index.d.ts create mode 100644 lib/build/recipe/oauth2provider/components/themes/themeBase.d.ts create mode 100644 lib/ts/components/assets/logoutIcon.tsx create mode 100644 lib/ts/recipe/oauth2provider/components/features/oauth2LogoutScreen/index.tsx create mode 100644 lib/ts/recipe/oauth2provider/components/themes/oauth2LogoutScreen/OAuth2LogoutScreenInner.tsx create mode 100644 lib/ts/recipe/oauth2provider/components/themes/oauth2LogoutScreen/index.tsx create mode 100644 lib/ts/recipe/oauth2provider/components/themes/styles.css create mode 100644 lib/ts/recipe/oauth2provider/components/themes/themeBase.tsx create mode 100644 stories/oauth2provider.stories.tsx diff --git a/examples/for-tests/src/OAuth2Page.js b/examples/for-tests/src/OAuth2Page.js index aa5b03839..3db24f8b8 100644 --- a/examples/for-tests/src/OAuth2Page.js +++ b/examples/for-tests/src/OAuth2Page.js @@ -23,7 +23,7 @@ const oidcConfig = { }; function AuthPage() { - const { signinRedirect, signinSilent, signoutSilent, user, error } = useAuth(); + const { signinRedirect, signinSilent, signoutSilent, signoutRedirect, user, error } = useAuth(); return (
@@ -36,6 +36,9 @@ function AuthPage() { + )}