Skip to content

Commit

Permalink
1321 - allow review-information app to redirect unauthenticated users…
Browse files Browse the repository at this point in the history
… to the sign-in form
  • Loading branch information
nicksayre committed Dec 30, 2024
1 parent 269f78f commit 6b1fc5c
Showing 1 changed file with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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 }) => {

Check warning on line 9 in src/applications/personalization/review-information/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/personalization/review-information/containers/App.jsx:9:23:'location' is missing in props validation

Check warning on line 9 in src/applications/personalization/review-information/containers/App.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/personalization/review-information/containers/App.jsx:9:33:'children' is missing in props validation
const serviceRequired = [backendServices.USER_PROFILE];

return (
<RoutedSavableApp formConfig={formConfig} currentLocation={location}>
{children}
<RequiredLoginView serviceRequired={serviceRequired} user={user} verify>
{children}
</RequiredLoginView>
</RoutedSavableApp>
);
}
};
App.propTypes = {
user: PropTypes.shape({
profile: PropTypes.shape({}),
}),
};

const mapStateToProps = state => ({
user: state.user,
});

export default connect(mapStateToProps)(App);

0 comments on commit 6b1fc5c

Please sign in to comment.