updated login and register to use oauth
This commit is contained in:
@@ -75,52 +75,70 @@ const RegisterComplete = (props) => {
|
||||
}
|
||||
});
|
||||
|
||||
return props.accountDetails.accCr == "created" ? (
|
||||
<>
|
||||
<p className="govuk-body">
|
||||
{t("account:register-new-account-confirmation-email")}
|
||||
</p>
|
||||
var registerBody = "";
|
||||
switch (props.accountDetails.accCr) {
|
||||
case "created":
|
||||
return (registerBody = (
|
||||
<>
|
||||
<p className="govuk-body">
|
||||
{t("account:register-new-account-confirmation-email")}
|
||||
</p>
|
||||
|
||||
<h2 className="govuk-heading-m">
|
||||
{t("account:register-new-account-sub-heading-what-next")}
|
||||
</h2>
|
||||
<h2 className="govuk-heading-m">
|
||||
{t(
|
||||
"account:register-new-account-sub-heading-what-next"
|
||||
)}
|
||||
</h2>
|
||||
|
||||
<p className="govuk-body">
|
||||
{t("account:register-new-account-paragraph-what-next")}
|
||||
</p>
|
||||
<p className="govuk-body">
|
||||
{t("account:register-new-account-paragraph-what-next")}
|
||||
</p>
|
||||
|
||||
<p className="govuk-body">
|
||||
<Link href="/">
|
||||
<a
|
||||
className="govuk-link"
|
||||
onClick={() => {
|
||||
setLogout(), window.localStorage.clear();
|
||||
}}
|
||||
>
|
||||
{t("account:register-new-account-my-portal-link")}
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<h2 className="govuk-heading-m">
|
||||
{t("account:register-new-account-account-failed")}
|
||||
</h2>
|
||||
<p className="govuk-body">
|
||||
<a
|
||||
onClick={() => {
|
||||
setRegisterFormComplete(false),
|
||||
setAccountCreatedComplete(false),
|
||||
setAccCr("false");
|
||||
}}
|
||||
className="govuk-link"
|
||||
>
|
||||
Try registering again
|
||||
</a>
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
<p className="govuk-body">
|
||||
<Link href="/">
|
||||
<a
|
||||
className="govuk-link"
|
||||
onClick={() => {
|
||||
setLogout(), window.localStorage.clear();
|
||||
}}
|
||||
>
|
||||
{t(
|
||||
"account:register-new-account-my-portal-link"
|
||||
)}
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
</>
|
||||
));
|
||||
|
||||
break;
|
||||
|
||||
case "exists":
|
||||
return (registerBody = (
|
||||
<>
|
||||
<h2 className="govuk-heading-m">
|
||||
{t("account:register-new-account-account-failed")}
|
||||
</h2>
|
||||
<p className="govuk-body">
|
||||
<a
|
||||
onClick={() => {
|
||||
setRegisterFormComplete(false),
|
||||
setAccountCreatedComplete(false),
|
||||
setAccCr(false);
|
||||
}}
|
||||
className="govuk-link"
|
||||
>
|
||||
Try registering again
|
||||
</a>
|
||||
</p>
|
||||
</>
|
||||
));
|
||||
|
||||
default:
|
||||
return (registerBody = "");
|
||||
break;
|
||||
}
|
||||
return registerBody;
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
|
||||
@@ -109,7 +109,7 @@ const RegisterForm = (props) => {
|
||||
setRegisterFormComplete(true);
|
||||
};
|
||||
|
||||
console.log(pristine);
|
||||
//console.log(pristine);
|
||||
return (
|
||||
<>
|
||||
{!pristine && !valid && (
|
||||
|
||||
@@ -24,41 +24,46 @@ const RenderTextfield = ({
|
||||
input,
|
||||
hint1,
|
||||
hint2,
|
||||
hint3,
|
||||
meta: { touched, error },
|
||||
...custom
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={
|
||||
touched && error
|
||||
? "govuk-form-group govuk-form-group--error"
|
||||
: "govuk-form-group "
|
||||
}
|
||||
>
|
||||
<div className="govuk-form-group">
|
||||
<div id="basicSearch-hint" className="govuk-hint ">
|
||||
<label
|
||||
className="govuk-label "
|
||||
htmlFor={id}
|
||||
id={id + "_label"}
|
||||
>
|
||||
{label}
|
||||
<span className="govuk-body-m">{hint1}</span>
|
||||
<span className="govuk-body-s">{hint1}</span>
|
||||
</label>
|
||||
|
||||
<br />
|
||||
<span className="govuk-body-s">
|
||||
{hint2} CAS-00009-W8N6W4
|
||||
</span>
|
||||
<ul className="govuk-body-s govuk-!-margin-top-3">
|
||||
<li>{hint2} </li>
|
||||
<li>{hint3}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{touched && error && (
|
||||
<span id={id + "-error"} className="govuk-error-message">
|
||||
<span className="govuk-visually-hidden">Error:</span>{" "}
|
||||
{error}
|
||||
</span>
|
||||
)}
|
||||
<input {...input} className={className} name={name} id={id} />
|
||||
<div>
|
||||
<input
|
||||
{...input}
|
||||
className={className}
|
||||
name={name}
|
||||
id={id}
|
||||
/>
|
||||
{touched && error && (
|
||||
<span
|
||||
id={id + "-error"}
|
||||
className="govuk-error-message govuk-form-group--error"
|
||||
>
|
||||
<span className="govuk-visually-hidden">
|
||||
Error:
|
||||
</span>{" "}
|
||||
{error}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
@@ -121,7 +126,10 @@ let CaseSearch = (props) => {
|
||||
aria-describedby="basicSearch-hint"
|
||||
hint1={t("myportal:searchcases-card-search-hint")}
|
||||
hint2={t(
|
||||
"myportal:searchcases-card-search-example-label"
|
||||
"myportal:searchcases-card-search-example-label-1"
|
||||
)}
|
||||
hint3={t(
|
||||
"myportal:searchcases-card-search-example-label-2"
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
@@ -218,16 +218,16 @@ const TopThree = (props) => {
|
||||
let noRecordsLabel = "";
|
||||
switch (topThreeType) {
|
||||
case "watchedCases":
|
||||
noRecordsLabel = "You are not watching any cases";
|
||||
noRecordsLabel = t("myportal:norecords-watched-cases");
|
||||
break;
|
||||
case "myRepresentations":
|
||||
noRecordsLabel = "You have no representations";
|
||||
noRecordsLabel = t("myportal:norecords-representations");
|
||||
break;
|
||||
case "myCases":
|
||||
noRecordsLabel = "You have no cases";
|
||||
noRecordsLabel = t("myportal:norecords-cases");
|
||||
break;
|
||||
case "awaitingSubmission":
|
||||
noRecordsLabel = "You have no awaiting submissions";
|
||||
noRecordsLabel = t("myportal:norecords-awaiting-submissions");
|
||||
break;
|
||||
}
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user