import { Heading, Section, Text } from "@react-email/components"; import React from "react"; import { BaseEmailWrapper, BaseEmailWrapperProps } from "./BaseEmailWrapper"; import { BaseLink } from "./BaseLink"; interface OAuthPasswordResetTemplateProps extends Omit { email: string; lastLoginMethod?: string | null; isCloud: boolean; } export const OAuthPasswordResetTemplate = ({ email, lastLoginMethod, isCloud, siteUrl }: OAuthPasswordResetTemplateProps) => { const getAuthMethodDisplayName = (method: string) => { return method .split("-") .map((word) => { const upperWord = word.toUpperCase(); if (["SAML", "LDAP", "OIDC", "SSO"].includes(upperWord)) { return upperWord; } return word.charAt(0).toUpperCase() + word.slice(1); }) .join(" "); }; const getAuthMethodMessage = () => { if (lastLoginMethod) { const displayName = getAuthMethodDisplayName(lastLoginMethod); return `Please continue by signing in with ${displayName}.`; } return "Please continue using the same authentication method you previously used to sign in (e.g., SSO, SAML, OAuth, or another configured provider)."; }; return ( Password Reset Not Available
Password reset is not available for this account. A password reset was requested for your Infisical account ({email}), but password login has not been enabled for your account. {getAuthMethodMessage()} If you did not initiate this request, please contact{" "} {isCloud ? ( <> us immediately at support@infisical.com ) : ( "your administrator immediately" )} .
); }; export default OAuthPasswordResetTemplate; OAuthPasswordResetTemplate.PreviewProps = { email: "user@example.com", lastLoginMethod: "github", isCloud: true, siteUrl: "https://infisical.com" } as OAuthPasswordResetTemplateProps;