[GIT-66] improvement: prevent disabling last enabled authentication method (#8570)

This commit is contained in:
Prateek Shourya 2026-01-27 00:47:37 +05:30 committed by GitHub
parent f7d5200ed8
commit 32a2584578
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 167 additions and 127 deletions

View file

@ -13,13 +13,13 @@ export type TOAuthOption = {
type OAuthOptionsProps = {
options: TOAuthOption[];
compact?: boolean;
showDivider?: boolean;
className?: string;
containerClassName?: string;
};
export function OAuthOptions(props: OAuthOptionsProps) {
const { options, compact = false, className = "", containerClassName = "" } = props;
const { options, compact = false, showDivider = true, className = "", containerClassName = "" } = props;
// Filter enabled options
const enabledOptions = options.filter((option) => option.enabled !== false);
@ -47,11 +47,13 @@ export function OAuthOptions(props: OAuthOptionsProps) {
))}
</div>
<div className="mt-4 flex items-center transition-all duration-300">
<hr className="w-full border-strong transition-colors duration-300" />
<p className="mx-3 flex-shrink-0 text-center text-13 text-placeholder transition-colors duration-300">or</p>
<hr className="w-full border-strong transition-colors duration-300" />
</div>
{showDivider && (
<div className="mt-4 flex items-center transition-all duration-300">
<hr className="w-full border-strong transition-colors duration-300" />
<p className="mx-3 flex-shrink-0 text-center text-13 text-placeholder transition-colors duration-300">or</p>
<hr className="w-full border-strong transition-colors duration-300" />
</div>
)}
</div>
);
}