mirror of
https://github.com/plankanban/planka.git
synced 2025-12-28 01:11:54 +03:00
fix: OIDC finalization and refactoring
This commit is contained in:
@@ -4,18 +4,18 @@ import selectors from '../selectors';
|
||||
import Core from '../components/Core';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const isCoreInitializing = selectors.selectIsCoreInitializing(state);
|
||||
const isInitializing = selectors.selectIsInitializing(state);
|
||||
const isSocketDisconnected = selectors.selectIsSocketDisconnected(state);
|
||||
const currentModal = selectors.selectCurrentModal(state);
|
||||
const currentProject = selectors.selectCurrentProject(state);
|
||||
const currentBoard = selectors.selectCurrentBoard(state);
|
||||
|
||||
return {
|
||||
isInitializing,
|
||||
isSocketDisconnected,
|
||||
currentModal,
|
||||
currentProject,
|
||||
currentBoard,
|
||||
isInitializing: isCoreInitializing,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
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 = ({
|
||||
ui: {
|
||||
authenticateForm: { data: defaultData, isSubmitting, error },
|
||||
},
|
||||
}) => ({
|
||||
defaultData,
|
||||
isSubmitting,
|
||||
error,
|
||||
});
|
||||
const mapStateToProps = (state) => {
|
||||
const oidcConfig = selectors.selectOidcConfig(state);
|
||||
|
||||
const {
|
||||
ui: {
|
||||
authenticateForm: { data: defaultData, isSubmitting, isSubmittingWithOidc, error },
|
||||
},
|
||||
} = state;
|
||||
|
||||
return {
|
||||
defaultData,
|
||||
isSubmitting,
|
||||
isSubmittingWithOidc,
|
||||
error,
|
||||
withOidc: !!oidcConfig,
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch) =>
|
||||
bindActionCreators(
|
||||
{
|
||||
onAuthenticate: entryActions.authenticate,
|
||||
onAuthenticateWithOidc: entryActions.authenticateWithOidc,
|
||||
onMessageDismiss: entryActions.clearAuthenticateError,
|
||||
},
|
||||
dispatch,
|
||||
|
||||
14
client/src/containers/LoginWrapperContainer.js
Normal file
14
client/src/containers/LoginWrapperContainer.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import selectors from '../selectors';
|
||||
import LoginWrapper from '../components/LoginWrapper';
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const isInitializing = selectors.selectIsInitializing(state);
|
||||
|
||||
return {
|
||||
isInitializing,
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(LoginWrapper);
|
||||
@@ -1,26 +0,0 @@
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import entryActions from '../entry-actions';
|
||||
import OidcLogin from '../components/OIDC';
|
||||
|
||||
const mapStateToProps = ({
|
||||
ui: {
|
||||
authenticateForm: { data: defaultData, isSubmitting, error },
|
||||
},
|
||||
}) => ({
|
||||
defaultData,
|
||||
isSubmitting,
|
||||
error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) =>
|
||||
bindActionCreators(
|
||||
{
|
||||
onAuthenticate: entryActions.authenticate,
|
||||
onMessageDismiss: entryActions.clearAuthenticateError,
|
||||
},
|
||||
dispatch,
|
||||
);
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(OidcLogin);
|
||||
@@ -14,8 +14,8 @@ const mapStateToProps = (state) => {
|
||||
phone,
|
||||
organization,
|
||||
language,
|
||||
isLocked,
|
||||
subscribeToOwnCards,
|
||||
isLocked,
|
||||
isAvatarUpdating,
|
||||
emailUpdateForm,
|
||||
passwordUpdateForm,
|
||||
@@ -30,8 +30,8 @@ const mapStateToProps = (state) => {
|
||||
phone,
|
||||
organization,
|
||||
language,
|
||||
isLocked,
|
||||
subscribeToOwnCards,
|
||||
isLocked,
|
||||
isAvatarUpdating,
|
||||
emailUpdateForm,
|
||||
passwordUpdateForm,
|
||||
|
||||
Reference in New Issue
Block a user