[GIT-66] improvement: prevent disabling last enabled authentication method (#8570)
This commit is contained in:
parent
f7d5200ed8
commit
32a2584578
7 changed files with 167 additions and 127 deletions
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue