Skip to content

Commit

Permalink
Modified the message for authentication failed
Browse files Browse the repository at this point in the history
Signed-off-by: Aravindhan Alagesan <[email protected]>
  • Loading branch information
aranaravi committed Feb 9, 2024
1 parent 47ca2ab commit 2ae8328
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions oidc-ui/src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function Form({
const { t, i18n } = useTranslation("translation", {
keyPrefix: i18nKeyPrefix,
});

const inputCustomClass =
"h-10 border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[hsla(0, 0%, 51%)] focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-muted-light-gray shadow-none";

Expand All @@ -41,7 +41,7 @@ export default function Form({
const [status, setStatus] = useState(states.LOADED);
const [invalidState, setInvalidState] = useState(true);

useEffect(() => {
useEffect(() => {
}, []);


Expand Down Expand Up @@ -101,6 +101,7 @@ export default function Form({
];

setStatus(states.LOADING);

const authenticateResponse = await post_AuthenticateUser(
transactionId,
uin,
Expand All @@ -113,9 +114,15 @@ export default function Form({
const { response, errors } = authenticateResponse;

if (errors != null && errors.length > 0) {
setError({
errorCode: `form.${errors[0].errorCode}`
});
if(errors[0].errorCode === "auth_failed"){
setError({
defaultMsg: t(`${errors[0].errorCode}`)
});
}else{
setError({
errorCode: `${errors[0].errorCode}`
});
}
return;
} else {
setError(null);
Expand Down

0 comments on commit 2ae8328

Please sign in to comment.