timeout redirect updated
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -64,7 +64,7 @@ const CaseSummary = (props) => {
|
||||
} = props;
|
||||
|
||||
const noRepresentationLink = [
|
||||
"/case",
|
||||
//"/case",
|
||||
"/dnsdetails",
|
||||
"/dns/[developmentName]",
|
||||
];
|
||||
|
||||
@@ -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={() => {
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user