Skip to content

Commit 9867ad7

Browse files
committed
feat: auth page
1 parent f479ee3 commit 9867ad7

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

frontend/src/components/AuthPage/SignIn/OAuthSignIn/AuthCard/AuthCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { ElementType } from 'react';
22
import ServiceImage from 'components/common/Icons/ServiceImage';
3-
import { useNavigate } from 'react-router-dom';
43

54
import * as S from './AuthCard.styled';
65

frontend/src/components/AuthPage/SignIn/OAuthSignIn/OAuthSignIn.styled.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,21 @@ export const OAuthSignInStyled = styled.div`
55
flex-direction: column;
66
gap: 8px;
77
`;
8+
9+
export const ErrorMessage = styled.div`
10+
display: flex;
11+
column-gap: 2px;
12+
align-items: center;
13+
justify-content: center;
14+
font-weight: 400;
15+
font-size: 14px;
16+
line-height: 20px;
17+
margin-bottom: 8px;
18+
`;
19+
20+
export const ErrorMessageText = styled.span`
21+
${({ theme }) => theme.auth_page.signIn.errorMessage};
22+
font-weight: 400;
23+
font-size: 14px;
24+
line-height: 20px;
25+
`;

frontend/src/components/AuthPage/SignIn/OAuthSignIn/OAuthSignIn.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import OktaIcon from 'components/common/Icons/OktaIcon';
66
import KeycloakIcon from 'components/common/Icons/KeycloakIcon';
77
import ServiceImage from 'components/common/Icons/ServiceImage';
88
import { OAuthProvider } from 'generated-sources';
9+
import { useLocation } from 'react-router-dom';
10+
import AlertIcon from 'components/common/Icons/AlertIcon';
911

1012
import * as S from './OAuthSignIn.styled';
1113
import AuthCard from './AuthCard/AuthCard';
@@ -24,8 +26,16 @@ const ServiceIconMap: Record<string, ElementType> = {
2426
};
2527

2628
function OAuthSignIn({ oAuthProviders }: Props) {
29+
const { search } = useLocation();
30+
2731
return (
2832
<S.OAuthSignInStyled>
33+
{search.includes('error') && (
34+
<S.ErrorMessage>
35+
<AlertIcon />
36+
<S.ErrorMessageText>Invalid credentials</S.ErrorMessageText>
37+
</S.ErrorMessage>
38+
)}
2939
{oAuthProviders?.map((provider) => (
3040
<AuthCard
3141
key={provider.clientName}

0 commit comments

Comments
 (0)