1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-03 20:45:27 +02:00
planka/client/src/actions/login.js

66 lines
1.2 KiB
JavaScript
Raw Normal View History

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
2019-08-31 04:07:25 +05:00
import ActionTypes from '../constants/ActionTypes';
2023-10-17 19:18:19 +02:00
const initializeLogin = (config) => ({
type: ActionTypes.LOGIN_INITIALIZE,
payload: {
config,
},
});
2022-08-04 13:31:14 +02:00
const authenticate = (data) => ({
2019-08-31 04:07:25 +05:00
type: ActionTypes.AUTHENTICATE,
payload: {
data,
},
});
authenticate.success = (accessToken) => ({
type: ActionTypes.AUTHENTICATE__SUCCESS,
2019-08-31 04:07:25 +05:00
payload: {
accessToken,
},
});
authenticate.failure = (error) => ({
type: ActionTypes.AUTHENTICATE__FAILURE,
2019-08-31 04:07:25 +05:00
payload: {
error,
},
});
const authenticateWithOidc = () => ({
type: ActionTypes.WITH_OIDC_AUTHENTICATE,
2023-10-17 19:18:19 +02:00
payload: {},
});
authenticateWithOidc.success = (accessToken) => ({
type: ActionTypes.WITH_OIDC_AUTHENTICATE__SUCCESS,
2023-10-17 19:18:19 +02:00
payload: {
accessToken,
},
});
authenticateWithOidc.failure = (error) => ({
type: ActionTypes.WITH_OIDC_AUTHENTICATE__FAILURE,
2023-10-17 19:18:19 +02:00
payload: {
error,
},
});
2022-08-04 13:31:14 +02:00
const clearAuthenticateError = () => ({
type: ActionTypes.AUTHENTICATE_ERROR_CLEAR,
payload: {},
});
2022-08-04 13:31:14 +02:00
export default {
2023-10-17 19:18:19 +02:00
initializeLogin,
2022-08-04 13:31:14 +02:00
authenticate,
authenticateWithOidc,
2022-08-04 13:31:14 +02:00
clearAuthenticateError,
};