timeout redirect updated

This commit is contained in:
2022-04-20 16:09:31 +01:00
parent 3b1a49e561
commit fba8529417
4 changed files with 24 additions and 9 deletions
+19 -5
View File
@@ -27,6 +27,7 @@ import RepAgent from "./representationAgent";
import RepInterestedPartyPerson from "./representationInterestedPartyPerson";
import RepLandOwner from "./representationLandowner";
import RepCompleteSubmit from "./representationCompleteSubmit";
import { useSession, signIn, signOut } from "next-auth/react";
import {
RenderPickList,
@@ -39,6 +40,7 @@ let MakeRepresentation = (props) => {
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
const [clearRepForm, setClearRepForm] = useState(false);
const { data: session } = useSession();
const router = useRouter();
const { locale } = router;
@@ -250,11 +252,23 @@ let MakeRepresentation = (props) => {
/>
) : (
<>
<h1 className="govuk-heading-l">
Make a representation on:{" "}
{currentView.caseReference.currentReference}
</h1>
{whichControl()}
{!session ? (
<button
className="govuk-button withChevron govuk-button-cta"
type="button"
onClick={() => signIn("email")}
>
Sign in to raise representation
</button>
) : (
<>
<h1 className="govuk-heading-l">
Make a representation on:{" "}
{currentView.caseReference.currentReference}
</h1>
{whichControl()}
</>
)}
</>
)}
</form>
+1 -1
View File
@@ -64,7 +64,7 @@ const CaseSummary = (props) => {
} = props;
const noRepresentationLink = [
"/case",
//"/case",
"/dnsdetails",
"/dns/[developmentName]",
];
+2 -2
View File
@@ -249,7 +249,7 @@ let Login = (props) => {
</button>
)}
</div>
{/* <form onSubmit={handleSubmit(onHandleSubmit)}>
<form onSubmit={handleSubmit(onHandleSubmit)}>
{validLoginID == false && (
<div className="govuk-error-message govuk-form-group--error">
Incorrect username or password
@@ -297,7 +297,7 @@ let Login = (props) => {
</button>
</div>
</form>
<div className="govuk-form-group govuk-!-margin-top-4">
{/* <div className="govuk-form-group govuk-!-margin-top-4">
<p className="govuk-body-xs">
<a
onClick={() => {
+2 -1
View File
@@ -4,6 +4,7 @@ import { destroyCookie } from "nookies";
import { useState } from "react";
import IdleTimer from "react-idle-timer";
import TimeoutModal from "./timeoutmodal";
import { useSession, signIn, signOut } from "next-auth/react";
const TimeOut = (props) => {
let { t } = useTranslation();
@@ -41,7 +42,7 @@ const TimeOut = (props) => {
console.log("////////////", "\n", "logout", "\n", "//////////");
destroyCookie({}, "pinsUser"),
window.localStorage.clear(),
router.replace(props.ggLogout);
signOut({ callbackUrl: "/logout" });
};
return (