1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00
planka/client/src/actions/login.js

61 lines
1.1 KiB
JavaScript
Raw Normal View History

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,
},
});
2023-10-17 19:18:19 +02:00
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,
},
});
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,
2023-10-17 19:18:19 +02:00
authenticateWithOidc,
2022-08-04 13:31:14 +02:00
clearAuthenticateError,
};