updated link for register user

This commit is contained in:
2023-12-21 12:22:20 +00:00
parent 593d416c18
commit 5ffd09f825
3 changed files with 25 additions and 25 deletions
+1 -2
View File
@@ -894,8 +894,7 @@ export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
export const getEmailAccountCheck = (emailAddress) => {
return axios
.get(
BASE_URL +
"/api/endpoint/getemailaccountcheck_api?emailAddress=" +
"/api/endpoint/getemailaccountcheck_api?emailAddress=" +
emailAddress
)
.then((res) => res.data)
+23 -22
View File
@@ -21,6 +21,8 @@ import {
} from "react-redux";
import { setAccCr, setLogout } from "../../store/accountDetails/action";
import { useSession, signIn, signOut } from "next-auth/react";
import { parseCookies, setCookie, destroyCookie } from "nookies";
import { getEmailAccountCheck, createAccount } from "../../actions";
@@ -53,6 +55,7 @@ const RegisterComplete = (props) => {
let checkEmailObj = {};
console.log("props.accountDetails.accCr :", props.accountDetails.accCr);
switch (props.accountDetails.accCr) {
case "created":
case "exists":
@@ -78,7 +81,7 @@ const RegisterComplete = (props) => {
var registerBody = "";
switch (props.accountDetails.accCr) {
case "created":
return registerBody = (
return (registerBody = (
<>
<p className="govuk-body">
{t("account:register-new-account-confirmation-email")}
@@ -98,30 +101,28 @@ const RegisterComplete = (props) => {
<Link
href="/"
className="govuk-link"
onClick={() => {
setLogout(),
window.localStorage.clear(),
destroyCookie(
null,
"next-auth.csrf-token"
),
destroyCookie(
null,
"next-auth.callback-url"
),
destroyCookie(null, "pedw_locale"),
destroyCookie(null, "pinsUser"),
signOut({ callbackUrl: "/logout" });
}}>
{t(
"account:register-new-account-my-portal-link"
)}
// onClick={() => {
// console.info(
// "////////////\n" +
// "logout" +
// "\n////////////"
// );
// window.localStorage.clear(),
// destroyCookie(null, "next-auth.csrf-token"),
// destroyCookie(
// null,
// "next-auth.callback-url"
// ),
// destroyCookie(null, "pedw_locale"),
// destroyCookie(null, "pinsUser"),
// signOut({ callbackUrl: "/logout" });
// }}
>
{t("account:register-new-account-my-portal-link")}
</Link>
</p>
</>
);
));
break;
+1 -1
View File
@@ -223,7 +223,7 @@ const authOptions = (locale, req, res) => {
error: (locale == "cy" ? "/cy" : "") + "/auth/error", // Error code passed in query string as ?error=
verifyRequest:
(locale == "cy" ? "/cy" : "") + "/auth/verify-request", // (used for check email message)
newUser: locale + "/account/register", // New users will be directed here on first sign in (leave the property out if not of interest)
newUser: (locale == "cy" ? "/cy" : "") + "/account/register", // New users will be directed here on first sign in (leave the property out if not of interest)
},
callbacks: {
session: async (session, user) => {