import { createSlice } from '@reduxjs/toolkit';

const initialState = {
  email: '',
  password: '',
  code: '',
  isCodeStep: false,
  isSsoAuthProcess: false,
  isSsoFailed: false,
};

export const slice = createSlice({
  name: '@@auth/AUTH',
  initialState,
  reducers: {
    setEmailAction: (state, action) => {
      state.email = action.payload;
    },
    setPasswordAction: (state, action) => {
      state.password = action.payload;
    },
    getUserDataEventAction: (state) => state,
    resetPasswordEventAction: (state) => state,
    setCodeStepAction: (state, action) => {
      state.isCodeStep = action.payload;
    },
    setCodeAction: (state, action) => {
      state.code = action.payload;
    },
    verifyCodeEventAction: (state) => state,
    getSsoLinkAction: (state) => state,
    setIsSsoAuthProcessAction: (state, action) => {
      state.isSsoAuthProcess = action.payload;
    },
    setSsoFailedAction: (state, action) => {
      state.isSsoFailed = action.payload;
    },
    getCustomLoginPageByAccountIdAction: (state) => state,
    getPasswordLessAuthAction: (state) => state,
    verifyPasswordLessAuthAction: (state) => state,
  },
});

export const {
  setEmailAction,
  setPasswordAction,
  getUserDataEventAction,
  resetPasswordEventAction,
  setCodeStepAction,
  setCodeAction,
  verifyCodeEventAction,
  getSsoLinkAction,
  setIsSsoAuthProcessAction,
  setSsoFailedAction,
  getCustomLoginPageByAccountIdAction,
  getPasswordLessAuthAction,
  verifyPasswordLessAuthAction,
} = slice.actions;
