-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixes redirect to correct 2fa page - Shows user's current MFA Status - Retrieves QR code to enable MFA - Adds toast to warn invalid code
- Loading branch information
1 parent
c690ed9
commit a85e445
Showing
7 changed files
with
67 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,23 @@ | ||
export default function MFAStatus({ | ||
status | ||
}: { | ||
status: "enabled" | "disabled"; | ||
}) { | ||
let color = ""; | ||
export default function MFAStatus({ status }: { status: boolean }) { | ||
let color = ""; | ||
|
||
switch (status) { | ||
case "enabled": | ||
case true: | ||
color = "bg-green-500"; | ||
break; | ||
case "disabled": | ||
case false: | ||
color = "bg-red-500"; | ||
break; | ||
default: | ||
color = "bg-gray-500"; | ||
break; | ||
} | ||
|
||
return( | ||
<span | ||
className={`inline-block px-2 py-0.5 text-xs font-semibold text-white ${color} rounded-full`} | ||
> | ||
Autenticação { status === "enabled" ? "ativada" : "desativada" } | ||
</span> | ||
) | ||
} | ||
return ( | ||
<span | ||
className={`inline-block px-2 py-0.5 text-xs font-semibold text-white ${color} rounded-full`} | ||
> | ||
Autenticação {status === true ? "ativada" : "desativada"} | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters