-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1321 - allow review-information app to redirect unauthenticated users…
… to the sign-in form
- Loading branch information
Showing
1 changed file
with
22 additions
and
4 deletions.
There are no files selected for viewing
26 changes: 22 additions & 4 deletions
26
src/applications/personalization/review-information/containers/App.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 GitHub Actions / Linting (Files Changed)
|
||
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); |