diff --git a/actions/services/accountDirectService.js b/actions/services/accountDirectService.js
index 20a41ec0..e86fa1ac 100644
--- a/actions/services/accountDirectService.js
+++ b/actions/services/accountDirectService.js
@@ -22,20 +22,6 @@ export const getLogin = (emailAddress, pwd) => {
});
};
-export const updatePassword = (contactId, newpassword) => {
- var queryUrl = "/api/endpoint/updateaccount_api?contactId=" + contactId;
- var data = { "pinswg_custom_password": newpassword };
- var config = {
- method: "post",
- url: queryUrl,
- data: data
- };
-
- return requestJson(config).catch((error) => {
- consoleLogger(error);
- });
-};
-
export const updateAccount = async (contactId, updateBody, ssr) => {
var queryUrl =
(ssr ? BASE_URL : "") +
diff --git a/actions/services/accountService.js b/actions/services/accountService.js
index 1cf7f7aa..85ddd0db 100644
--- a/actions/services/accountService.js
+++ b/actions/services/accountService.js
@@ -1,7 +1,6 @@
import {
getPersonalAccount,
getLogin,
- updatePassword,
updateAccount,
createAccount,
getEmailAccountCheck,
@@ -13,7 +12,6 @@ import {
export {
getPersonalAccount,
getLogin,
- updatePassword,
updateAccount,
createAccount,
getEmailAccountCheck,
diff --git a/components/account/changepassword.js b/components/account/changepassword.js
deleted file mode 100644
index 760be8a8..00000000
--- a/components/account/changepassword.js
+++ /dev/null
@@ -1,184 +0,0 @@
-import useTranslation from "next-translate/useTranslation";
-import Link from "next/link";
-import { useRouter } from "next/router";
-import React, { useState } from "react";
-import { connect } from "react-redux";
-import { Field, formValueSelector, reduxForm } from "redux-form";
-import { updatePassword } from "../../actions/services/accountService";
-
-const RenderTextfield = ({
- id,
- className,
- rows,
- datafieldname,
- name,
- label,
- input,
- type,
- errorMsg,
- meta: { touched, error },
- ...custom
-}) => {
- return (
- <>
-
-
- {touched && error && (
-
- Error:{" "}
- {touched &&
- ((error && (
- {errorMsg ? errorMsg : error}
- )) ||
- (warning && {warning}))}
-
- )}
-
-
- >
- );
-};
-
-const ChangePassword = (props) => {
- const {
- footerLinks,
- pages,
- handleSubmit,
- value,
- setPasswordUpdated,
- passwordUpdated
- } = props;
- let { t, lang } = useTranslation();
-
- const router = useRouter();
- const { locale } = router;
-
- let errorsobj = {};
-
- const onHandleSubmit = (values) => {
- let contactid = props.props.accountDetails.loggedinUserId;
- let updateBody = props.props.form.changepasswordForm.values.newpassword;
- console.log(contactid, updateBody);
- updatePassword(contactid, updateBody);
- setPasswordUpdated(true);
- };
-
- const required = (value) => (value ? undefined : "Is required");
-
- const passwordsMustMatch = (value, allValues) =>
- value !== allValues.newpassword ? "Passwords do not match" : undefined;
-
- const minLength = (min) => (value) =>
- value && value.length < min
- ? `Must be at least ${min} characters`
- : undefined;
-
- const [hasErrors, setHasErrors] = useState("");
-
- return (
- <>
- {passwordUpdated != true ? (
-
- ) : (
- <>
-
-
- Go to My Portal
-
-
- >
- )}
- >
- );
-};
-
-const mapStateToProps = (state) => {
- return {
- search: state.search,
- searchResultsObj: state.searchResultsObj,
- formData: state.formData,
- appealType: state.appealType,
- accountDetails: state.accountDetails
- //form: state.form,
- };
-};
-
-const mapDispatchToProps = (dispatch) => {
- return {
- setCurrentSection: (currentSection) => {
- dispatch(setCurrentSection(currentSection));
- }
- };
-};
-
-const selector = formValueSelector("changepasswordForm"); // <-- same as form name
-
-export default connect(
- mapStateToProps,
- mapDispatchToProps
-)(
- reduxForm({
- form: "changepasswordForm",
- destroyOnUnmount: false
- })(ChangePassword)
-);
diff --git a/components/myportal/youraccount.js b/components/myportal/youraccount.js
index 0f6bb6cf..64fbf470 100644
--- a/components/myportal/youraccount.js
+++ b/components/myportal/youraccount.js
@@ -27,24 +27,6 @@ export default function YourAccount() {
-
- {/*
-
- {t("myportal:changepassword-card-title")}
-
-
- {" "}
- {t("myportal:changepassword-card-paragraph-one")}
-
-
-
-
*/}
>
);
diff --git a/lib/routing/breadcrumbRendererFactories.js b/lib/routing/breadcrumbRendererFactories.js
index 0d0961db..8bf1bec3 100644
--- a/lib/routing/breadcrumbRendererFactories.js
+++ b/lib/routing/breadcrumbRendererFactories.js
@@ -472,15 +472,6 @@ export const createDetailAndAccountRouteRenderers = ({
{t("account:account-title")}
>
- ),
-
- "/account/changepassword": () => (
- <>
- {renderLinkCrumb(cyMyPortalHref, t("common:breadcrumb-my-portal"))}
-
- Update your password
-
- >
)
});
diff --git a/pages/account/changepassword.js b/pages/account/changepassword.js
deleted file mode 100644
index 92b19237..00000000
--- a/pages/account/changepassword.js
+++ /dev/null
@@ -1,120 +0,0 @@
-import Link from "next/link";
-import _ from "lodash";
-import Head from "next/head";
-import Header from "../../components/header";
-import Banner from "../../components/banner";
-import CookieBanner from "../../components/cookieBanner";
-import Breadcrumbs from "../../components/breadcrumbs";
-import Footer from "../../components/footer";
-
-import { useSelector, shallowEqual, connect } from "react-redux";
-import { wrapper } from "../../store/store";
-
-import { useRouter } from "next/router";
-import { useState } from "react";
-import useTranslation from "next-translate/useTranslation";
-import { JSONPath as jsonpath } from "jsonpath-plus";
-import { reduxForm, formValueSelector } from "redux-form";
-
-import ChangePassword from "../../components/account/changepassword";
-import xpath from "xpath";
-import {
- setAppealType,
- setAppealTypeTitle,
- setAppealTypeID,
- setAppealLPA,
- getAppealTypeObj
-} from "../../store/appealType/action";
-import {
- getAppealsTypes,
- getLPA
-} from "../../actions/services/referenceDataService";
-import { setLPA } from "../../store/lpa/action";
-
-import { getSession, useSession } from "next-auth/react";
-import NoSessionWarning from "../../components/nosession";
-
-const Home = (props) => {
- const { footerLinks, pages, formData } = props;
- let { t, lang } = useTranslation();
-
- const router = useRouter();
- const { locale } = router;
- const { appealtypes } = router.query;
-
- const { appealType, LPAData } = props;
- const [passwordUpdated, setPasswordUpdated] = useState(false);
-
- const { data: session, status } = useSession();
-
- if (status === "loading") {
- return ;
- }
-
- if (status === "unauthenticated") {
- router.push("/auth/signin");
- return ;
- }
-
- return (
-
-
-
- {t("search:page-title")} - {t("common:service-name")}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {passwordUpdated == true ? (
-
- Your password has been changed
-
- ) : (
- Change password
- )}
-
-
-
-
-
-
-
-
-
-
-
- );
-};
-
-const mapStateToProps = (state) => {
- return {
- search: state.search,
- searchResultsObj: state.searchResultsObj,
- formData: state.formData,
- appealType: state.appealType,
- LPAData: state.LPAData,
- form: state.form,
- accountDetails: state.accountDetails
- };
-};
-
-export default connect(mapStateToProps)(Home);
diff --git a/pages/api/endpoint/updatepassword_api.js b/pages/api/endpoint/updatepassword_api.js
deleted file mode 100644
index dc8a64cb..00000000
--- a/pages/api/endpoint/updatepassword_api.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * @swagger
- * /api/endpoint/updatepassword_api:
- * patch:
- * tags: [Account]
- * description: Update password
- * summary: Phase 2
- * responses:
- * 200:
- * description: Success
- */
-
-import axios from "axios";
-import { consoleLogger } from "../../../actions/core/logger";
-import { getToken } from "../../../actions/core/token";
-import { hashAPIPath } from "../../../actions/core/hash";
-import { respondError, respondSuccess } from "../middleware/apiResponse";
-
-const WEBAPI_URL =
- process.env.RELAY_ROOT ||
- "https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
-
-export default async function ApiProxy(req, res) {
- const contactId = req.query.contactId;
-
- if (typeof contactId !== "string" || contactId.trim().length === 0) {
- return respondError(res, {
- status: 400,
- code: "CONTACT_ID_REQUIRED",
- message: "contactId is required"
- });
- }
-
- if (!req.body || Object.keys(req.body).length === 0) {
- return respondError(res, {
- status: 400,
- code: "PASSWORD_UPDATE_PAYLOAD_REQUIRED",
- message: "Password update payload is required"
- });
- }
-
- try {
- const token = await getToken();
- const data = JSON.stringify(req.body);
- const queryUrl = "contacts(" + contactId + ")";
-
- const config = {
- method: "patch",
- url: WEBAPI_URL + queryUrl + hashAPIPath(queryUrl),
- headers: {
- "OData-MaxVersion": "4.0",
- "OData-Version": "4.0",
- Accept: "application/json",
- Prefer: 'odata.include-annotations="*",return=representation',
- Authorization: "Bearer " + token.access_token,
- "Content-Type": "application/json"
- },
- data
- };
-
- const response = await axios(config);
- return respondSuccess(res, response.data);
- } catch (error) {
- consoleLogger(error);
- return respondError(res, {
- status: 400,
- code: "PASSWORD_UPDATE_FAILED",
- message: "Failed to update password"
- });
- }
-}
diff --git a/tests/phase21/endpoint-handler-contract.test.cjs b/tests/phase21/endpoint-handler-contract.test.cjs
index 6c3b2f0f..dfbb3b2b 100644
--- a/tests/phase21/endpoint-handler-contract.test.cjs
+++ b/tests/phase21/endpoint-handler-contract.test.cjs
@@ -982,68 +982,6 @@ test("updateaccount catch path returns ACCOUNT_UPDATE_FAILED", async () => {
assert.strictEqual(res.state.jsonBody.error.code, "ACCOUNT_UPDATE_FAILED");
});
-test("updatepassword returns CONTACT_ID_REQUIRED when contactId missing", async () => {
- const mod = loadModule("pages/api/endpoint/updatepassword_api.js", {
- respondError: respondErrorMock,
- respondSuccess: respondSuccessMock,
- getToken: async () => ({ access_token: "token" }),
- hashAPIPath: () => "&hash=expected",
- axios: async () => ({ data: { contactid: "c1" } }),
- consoleLogger: () => {}
- });
-
- const req = { query: {}, body: { pinswg_password: "abc" } };
- const res = createRes();
- await mod.default(req, res);
-
- assert.strictEqual(res.state.statusCode, 400);
- assert.strictEqual(res.state.jsonBody.error.code, "CONTACT_ID_REQUIRED");
-});
-
-test("updatepassword returns PASSWORD_UPDATE_PAYLOAD_REQUIRED when body missing", async () => {
- const mod = loadModule("pages/api/endpoint/updatepassword_api.js", {
- respondError: respondErrorMock,
- respondSuccess: respondSuccessMock,
- getToken: async () => ({ access_token: "token" }),
- hashAPIPath: () => "&hash=expected",
- axios: async () => ({ data: { contactid: "c1" } }),
- consoleLogger: () => {}
- });
-
- const req = { query: { contactId: "c1" }, body: undefined };
- const res = createRes();
- await mod.default(req, res);
-
- assert.strictEqual(res.state.statusCode, 400);
- assert.strictEqual(
- res.state.jsonBody.error.code,
- "PASSWORD_UPDATE_PAYLOAD_REQUIRED"
- );
-});
-
-test("updatepassword catch path returns PASSWORD_UPDATE_FAILED", async () => {
- const mod = loadModule("pages/api/endpoint/updatepassword_api.js", {
- respondError: respondErrorMock,
- respondSuccess: respondSuccessMock,
- getToken: async () => ({ access_token: "token" }),
- hashAPIPath: () => "&hash=expected",
- axios: async () => {
- throw new Error("relay failed");
- },
- consoleLogger: () => {}
- });
-
- const req = {
- query: { contactId: "c1" },
- body: { pinswg_password: "abc" }
- };
- const res = createRes();
- await mod.default(req, res);
-
- assert.strictEqual(res.state.statusCode, 400);
- assert.strictEqual(res.state.jsonBody.error.code, "PASSWORD_UPDATE_FAILED");
-});
-
test("getbasicsearch returns SEARCH_STRING_REQUIRED when searchString missing", async () => {
const mod = loadModule("pages/api/endpoint/getbasicsearch_api.js", {
respondError: respondErrorMock,
diff --git a/tests/phase22/breadcrumbs-route-map-structure.test.cjs b/tests/phase22/breadcrumbs-route-map-structure.test.cjs
index 4dfd31a3..f416dca4 100644
--- a/tests/phase22/breadcrumbs-route-map-structure.test.cjs
+++ b/tests/phase22/breadcrumbs-route-map-structure.test.cjs
@@ -203,12 +203,6 @@ test("breadcrumbs/factory module includes expected mapped route definitions", as
true,
"Expected /account/personaldetails to be mapped in createDetailAndAccountRouteRenderers"
);
-
- assert.strictEqual(
- source.includes('"/account/changepassword": () =>'),
- true,
- "Expected /account/changepassword to be mapped in createDetailAndAccountRouteRenderers"
- );
});
test("breadcrumbs/component composes mapped routes via imported factories and shared resolver", async () => {