1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-25 16:19:47 +02:00
planka/client/src/containers/LoginContainer.js

37 lines
897 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: {
2023-10-19 16:05:34 +02:00
authenticateForm: { data: defaultData, isSubmitting, isSubmittingUsingOidc, error },
2023-10-17 19:18:19 +02:00
},
} = state;
return {
defaultData,
isSubmitting,
2023-10-19 16:05:34 +02:00
isSubmittingUsingOidc,
2023-10-17 19:18:19 +02:00
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-19 16:05:34 +02:00
onAuthenticateUsingOidc: entryActions.authenticateUsingOidc,
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);