1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-27 00:59:44 +02:00
planka/client/src/containers/LoginContainer.js

37 lines
893 B
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
2023-10-17 19:18:19 +02:00
import selectors from '../selectors';
2022-08-04 13:31:14 +02:00
import entryActions from '../entry-actions';
2019-08-31 04:07:25 +05:00
import Login from '../components/Login';
2023-10-17 19:18:19 +02:00
const mapStateToProps = (state) => {
const oidcConfig = selectors.selectOidcConfig(state);
const {
ui: {
authenticateForm: { data: defaultData, isSubmitting, isSubmittingWithOidc, error },
},
} = state;
return {
defaultData,
isSubmitting,
isSubmittingWithOidc,
error,
withOidc: !!oidcConfig,
};
};
2019-08-31 04:07:25 +05:00
2020-03-25 00:15:47 +05:00
const mapDispatchToProps = (dispatch) =>
bindActionCreators(
{
2022-08-04 13:31:14 +02:00
onAuthenticate: entryActions.authenticate,
2023-10-17 19:18:19 +02:00
onAuthenticateWithOidc: entryActions.authenticateWithOidc,
2022-08-04 13:31:14 +02:00
onMessageDismiss: entryActions.clearAuthenticateError,
},
dispatch,
);
2019-08-31 04:07:25 +05:00
export default connect(mapStateToProps, mapDispatchToProps)(Login);