From 6b1fc5c5c91933b4b29197182ff26d997506dc2d Mon Sep 17 00:00:00 2001 From: Nick Sayre Date: Fri, 27 Dec 2024 12:41:38 -0600 Subject: [PATCH] 1321 - allow review-information app to redirect unauthenticated users to the sign-in form --- .../review-information/containers/App.jsx | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/applications/personalization/review-information/containers/App.jsx b/src/applications/personalization/review-information/containers/App.jsx index 797306ee1e20..8a16483d95f8 100644 --- a/src/applications/personalization/review-information/containers/App.jsx +++ b/src/applications/personalization/review-information/containers/App.jsx @@ -1,12 +1,30 @@ import React from 'react'; - +import { connect } from 'react-redux'; +import PropTypes from 'prop-types'; import RoutedSavableApp from 'platform/forms/save-in-progress/RoutedSavableApp'; +import { RequiredLoginView } from '@department-of-veterans-affairs/platform-user/RequiredLoginView'; +import backendServices from '@department-of-veterans-affairs/platform-user/profile/backendServices'; import formConfig from '../config/form'; -export default function App({ location, children }) { +export const App = ({ location, children, user }) => { + const serviceRequired = [backendServices.USER_PROFILE]; + return ( - {children} + + {children} + ); -} +}; +App.propTypes = { + user: PropTypes.shape({ + profile: PropTypes.shape({}), + }), +}; + +const mapStateToProps = state => ({ + user: state.user, +}); + +export default connect(mapStateToProps)(App);