From 7f19ec12650f65748399e5cda609a1a13e783ae3 Mon Sep 17 00:00:00 2001 From: Lucas Smith Date: Tue, 28 Oct 2025 17:02:26 +1100 Subject: [PATCH] fix: embedded direct template recipient auth --- .../embed/embed-authentication-required.tsx | 3 + apps/remix/app/components/forms/signin.tsx | 105 ++++++++++-------- apps/remix/app/components/forms/signup.tsx | 4 +- .../document-signing-auth-account.tsx | 32 ++++-- .../document-signing-auth-dialog.tsx | 9 +- .../document-signing-auth-provider.tsx | 4 + .../routes/_recipient+/d.$token+/_index.tsx | 1 + .../app/routes/_unauthenticated+/signin.tsx | 37 +++++- .../app/routes/_unauthenticated+/signup.tsx | 11 +- apps/remix/app/routes/embed+/_v0+/_layout.tsx | 7 +- .../app/routes/embed+/_v0+/direct.$token.tsx | 2 +- .../lib/utils/handle-oauth-callback-url.ts | 7 ++ packages/lib/utils/is-valid-return-to.ts | 37 ++++++ 13 files changed, 191 insertions(+), 68 deletions(-) create mode 100644 packages/lib/utils/is-valid-return-to.ts diff --git a/apps/remix/app/components/embed/embed-authentication-required.tsx b/apps/remix/app/components/embed/embed-authentication-required.tsx index db65e7a2f..4147f0e6f 100644 --- a/apps/remix/app/components/embed/embed-authentication-required.tsx +++ b/apps/remix/app/components/embed/embed-authentication-required.tsx @@ -9,6 +9,7 @@ export type EmbedAuthenticationRequiredProps = { email?: string; returnTo: string; isGoogleSSOEnabled?: boolean; + isMicrosoftSSOEnabled?: boolean; isOIDCSSOEnabled?: boolean; oidcProviderLabel?: string; }; @@ -17,6 +18,7 @@ export const EmbedAuthenticationRequired = ({ email, returnTo, // isGoogleSSOEnabled, + // isMicrosoftSSOEnabled, // isOIDCSSOEnabled, // oidcProviderLabel, }: EmbedAuthenticationRequiredProps) => { @@ -37,6 +39,7 @@ export const EmbedAuthenticationRequired = ({ Signing in... : Sign In} - {hasSocialAuthEnabled && ( -
-
- - Or continue with - -
-
- )} + {!isEmbeddedRedirect && ( + <> + {hasSocialAuthEnabled && ( +
+
+ + Or continue with + +
+
+ )} - {isGoogleSSOEnabled && ( - - )} + {isGoogleSSOEnabled && ( + + )} - {isMicrosoftSSOEnabled && ( - - )} + {isMicrosoftSSOEnabled && ( + + )} - {isOIDCSSOEnabled && ( - + {isOIDCSSOEnabled && ( + + )} + )}