mirror of
https://github.com/plankanban/planka.git
synced 2025-07-24 07:39:44 +02:00
36 lines
897 B
JavaScript
Executable file
36 lines
897 B
JavaScript
Executable file
import { bindActionCreators } from 'redux';
|
|
import { connect } from 'react-redux';
|
|
|
|
import selectors from '../selectors';
|
|
import entryActions from '../entry-actions';
|
|
import Login from '../components/Login';
|
|
|
|
const mapStateToProps = (state) => {
|
|
const oidcConfig = selectors.selectOidcConfig(state);
|
|
|
|
const {
|
|
ui: {
|
|
authenticateForm: { data: defaultData, isSubmitting, isSubmittingUsingOidc, error },
|
|
},
|
|
} = state;
|
|
|
|
return {
|
|
defaultData,
|
|
isSubmitting,
|
|
isSubmittingUsingOidc,
|
|
error,
|
|
withOidc: !!oidcConfig,
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch) =>
|
|
bindActionCreators(
|
|
{
|
|
onAuthenticate: entryActions.authenticate,
|
|
onAuthenticateUsingOidc: entryActions.authenticateUsingOidc,
|
|
onMessageDismiss: entryActions.clearAuthenticateError,
|
|
},
|
|
dispatch,
|
|
);
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Login);
|