Skip to content

Commit 9cf4b1b

Browse files
committed
fix(eng-4621): address feedback, use new badge, fix saving
1 parent 6bbf3c5 commit 9cf4b1b

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

frontend/src/pages/auth/LoginPage/components/InitialStep/InitialStep.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { createNotification } from "@app/components/notifications";
1212
import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
1313
import attemptLogin from "@app/components/utilities/attemptLogin";
1414
import { Button, Input } from "@app/components/v2";
15+
import { Badge } from "@app/components/v3";
1516
import { envConfig } from "@app/config/env";
1617
import { useServerConfig } from "@app/context";
1718
import { useFetchServerStatus } from "@app/hooks/api";
@@ -74,12 +75,14 @@ export const InitialStep = ({
7475

7576
useEffect(() => {
7677
if (serverDetails?.samlDefaultOrgSlug && !isAdmin) {
78+
saveLastLogin({ method: LoginMethod.SAML, orgSlug: serverDetails.samlDefaultOrgSlug });
7779
redirectToSaml(serverDetails.samlDefaultOrgSlug);
7880
}
7981
}, [serverDetails?.samlDefaultOrgSlug]);
8082

8183
const handleSaml = () => {
8284
if (config.defaultAuthOrgSlug) {
85+
saveLastLogin({ method: LoginMethod.SAML, orgSlug: config.defaultAuthOrgSlug });
8386
redirectToSaml(config.defaultAuthOrgSlug);
8487
} else {
8588
setStep(2);
@@ -88,6 +91,7 @@ export const InitialStep = ({
8891

8992
const handleOidc = () => {
9093
if (config.defaultAuthOrgSlug) {
94+
saveLastLogin({ method: LoginMethod.OIDC, orgSlug: config.defaultAuthOrgSlug });
9195
redirectToOidc(config.defaultAuthOrgSlug);
9296
} else {
9397
setStep(3);
@@ -333,9 +337,9 @@ export const InitialStep = ({
333337
Continue with Email
334338
</Button>
335339
{isLastUsedMethod(LoginMethod.EMAIL) && (
336-
<span className="absolute -top-2 -right-2 rounded-full bg-primary/20 px-1.5 py-0.5 text-[10px] text-primary">
340+
<Badge variant="info" className="absolute -top-2 -right-2 rounded-full">
337341
Last used
338-
</span>
342+
</Badge>
339343
)}
340344
</div>
341345
</>

frontend/src/pages/auth/LoginPage/components/OrgLoginButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
33
import { twMerge } from "tailwind-merge";
44

55
import { Button } from "@app/components/v2";
6+
import { Badge } from "@app/components/v3";
67

78
type Props = {
89
label: string;
@@ -28,9 +29,9 @@ export const OrgLoginButton = ({ label, onClick, className, showLastUsed }: Prop
2829
{label}
2930
</Button>
3031
{showLastUsed && (
31-
<span className="absolute -top-2 -right-2 rounded-full bg-primary/20 px-1.5 py-0.5 text-[10px] text-primary">
32+
<Badge variant="info" className="absolute -top-2 -right-2 rounded-full">
3233
Last used
33-
</span>
34+
</Badge>
3435
)}
3536
</div>
3637
);

frontend/src/pages/auth/LoginPage/components/SocialLoginButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { IconDefinition } from "@fortawesome/free-brands-svg-icons";
22
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
33

44
import { IconButton, Tooltip } from "@app/components/v2";
5+
import { Badge } from "@app/components/v3";
56

67
type Props = {
78
icon: IconDefinition;
@@ -23,9 +24,9 @@ export const SocialLoginButton = ({ icon, label, onClick, showLastUsed }: Props)
2324
<FontAwesomeIcon icon={icon} />
2425
</IconButton>
2526
{showLastUsed && (
26-
<span className="absolute -top-2 -right-2 rounded-full bg-primary/20 px-1.5 py-0.5 text-[10px] text-primary">
27+
<Badge variant="info" className="absolute -top-2 -right-2 rounded-full">
2728
Last used
28-
</span>
29+
</Badge>
2930
)}
3031
</div>
3132
</Tooltip>

0 commit comments

Comments
 (0)