Merged PR 1048: updated link for register user
updated link for register user Related work items: #9967
This commit is contained in:
+1
-2
@@ -894,8 +894,7 @@ export const getPortalModuleDetailsProxy = (appealType, caseReference) => {
|
|||||||
export const getEmailAccountCheck = (emailAddress) => {
|
export const getEmailAccountCheck = (emailAddress) => {
|
||||||
return axios
|
return axios
|
||||||
.get(
|
.get(
|
||||||
BASE_URL +
|
"/api/endpoint/getemailaccountcheck_api?emailAddress=" +
|
||||||
"/api/endpoint/getemailaccountcheck_api?emailAddress=" +
|
|
||||||
emailAddress
|
emailAddress
|
||||||
)
|
)
|
||||||
.then((res) => res.data)
|
.then((res) => res.data)
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import {
|
|||||||
} from "react-redux";
|
} from "react-redux";
|
||||||
|
|
||||||
import { setAccCr, setLogout } from "../../store/accountDetails/action";
|
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";
|
import { getEmailAccountCheck, createAccount } from "../../actions";
|
||||||
|
|
||||||
@@ -53,6 +55,7 @@ const RegisterComplete = (props) => {
|
|||||||
|
|
||||||
let checkEmailObj = {};
|
let checkEmailObj = {};
|
||||||
|
|
||||||
|
console.log("props.accountDetails.accCr :", props.accountDetails.accCr);
|
||||||
switch (props.accountDetails.accCr) {
|
switch (props.accountDetails.accCr) {
|
||||||
case "created":
|
case "created":
|
||||||
case "exists":
|
case "exists":
|
||||||
@@ -78,7 +81,7 @@ const RegisterComplete = (props) => {
|
|||||||
var registerBody = "";
|
var registerBody = "";
|
||||||
switch (props.accountDetails.accCr) {
|
switch (props.accountDetails.accCr) {
|
||||||
case "created":
|
case "created":
|
||||||
return registerBody = (
|
return (registerBody = (
|
||||||
<>
|
<>
|
||||||
<p className="govuk-body">
|
<p className="govuk-body">
|
||||||
{t("account:register-new-account-confirmation-email")}
|
{t("account:register-new-account-confirmation-email")}
|
||||||
@@ -98,30 +101,28 @@ const RegisterComplete = (props) => {
|
|||||||
<Link
|
<Link
|
||||||
href="/"
|
href="/"
|
||||||
className="govuk-link"
|
className="govuk-link"
|
||||||
onClick={() => {
|
// onClick={() => {
|
||||||
setLogout(),
|
// console.info(
|
||||||
window.localStorage.clear(),
|
// "////////////\n" +
|
||||||
destroyCookie(
|
// "logout" +
|
||||||
null,
|
// "\n////////////"
|
||||||
"next-auth.csrf-token"
|
// );
|
||||||
),
|
// window.localStorage.clear(),
|
||||||
destroyCookie(
|
// destroyCookie(null, "next-auth.csrf-token"),
|
||||||
null,
|
// destroyCookie(
|
||||||
"next-auth.callback-url"
|
// null,
|
||||||
),
|
// "next-auth.callback-url"
|
||||||
destroyCookie(null, "pedw_locale"),
|
// ),
|
||||||
destroyCookie(null, "pinsUser"),
|
// destroyCookie(null, "pedw_locale"),
|
||||||
signOut({ callbackUrl: "/logout" });
|
// destroyCookie(null, "pinsUser"),
|
||||||
}}>
|
// signOut({ callbackUrl: "/logout" });
|
||||||
|
// }}
|
||||||
{t(
|
>
|
||||||
"account:register-new-account-my-portal-link"
|
{t("account:register-new-account-my-portal-link")}
|
||||||
)}
|
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
</>
|
</>
|
||||||
);
|
));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ const authOptions = (locale, req, res) => {
|
|||||||
error: (locale == "cy" ? "/cy" : "") + "/auth/error", // Error code passed in query string as ?error=
|
error: (locale == "cy" ? "/cy" : "") + "/auth/error", // Error code passed in query string as ?error=
|
||||||
verifyRequest:
|
verifyRequest:
|
||||||
(locale == "cy" ? "/cy" : "") + "/auth/verify-request", // (used for check email message)
|
(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: {
|
callbacks: {
|
||||||
session: async (session, user) => {
|
session: async (session, user) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user