mirror of
https://github.com/plankanban/planka.git
synced 2025-12-30 09:15:35 +03:00
fix: OIDC finalization and refactoring
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
const initializeCore = (
|
||||
config,
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
@@ -20,6 +21,7 @@ const initializeCore = (
|
||||
) => ({
|
||||
type: ActionTypes.CORE_INITIALIZE,
|
||||
payload: {
|
||||
config,
|
||||
user,
|
||||
board,
|
||||
users,
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import ActionTypes from '../constants/ActionTypes';
|
||||
|
||||
const initializeLogin = (config) => ({
|
||||
type: ActionTypes.LOGIN_INITIALIZE,
|
||||
payload: {
|
||||
config,
|
||||
},
|
||||
});
|
||||
|
||||
const authenticate = (data) => ({
|
||||
type: ActionTypes.AUTHENTICATE,
|
||||
payload: {
|
||||
@@ -21,12 +28,33 @@ authenticate.failure = (error) => ({
|
||||
},
|
||||
});
|
||||
|
||||
const authenticateWithOidc = () => ({
|
||||
type: ActionTypes.WITH_OIDC_AUTHENTICATE,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
authenticateWithOidc.success = (accessToken) => ({
|
||||
type: ActionTypes.WITH_OIDC_AUTHENTICATE__SUCCESS,
|
||||
payload: {
|
||||
accessToken,
|
||||
},
|
||||
});
|
||||
|
||||
authenticateWithOidc.failure = (error) => ({
|
||||
type: ActionTypes.WITH_OIDC_AUTHENTICATE__FAILURE,
|
||||
payload: {
|
||||
error,
|
||||
},
|
||||
});
|
||||
|
||||
const clearAuthenticateError = () => ({
|
||||
type: ActionTypes.AUTHENTICATE_ERROR_CLEAR,
|
||||
payload: {},
|
||||
});
|
||||
|
||||
export default {
|
||||
initializeLogin,
|
||||
authenticate,
|
||||
authenticateWithOidc,
|
||||
clearAuthenticateError,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user