Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3736 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3736 Rev 3740
Línea 1... Línea 1...
1
import { axios, isAndroidDevice, isIOSDevice, loginUserToNative, logoutUserToNative } from '@utils';
1
import { axios, isAndroidDevice, isIOSDevice, loginUserToNative, logoutUserToNative } from '@utils';
2
import { actionsTypes } from './auth.types';
2
import { actionsTypes } from './auth.types';
Línea -... Línea 3...
-
 
3
 
-
 
4
const ENV = import.meta.env.VITE_ENVIROMENT;
3
 
5
 
4
export const setCrendentials = (crendentials) => ({
6
export const setCrendentials = (crendentials) => ({
5
  type: actionsTypes.SET_CREDENTIALS,
7
  type: actionsTypes.SET_CREDENTIALS,
6
  payload: crendentials
8
  payload: crendentials
Línea 34... Línea 36...
34
  };
36
  };
35
};
37
};
Línea 36... Línea 38...
36
 
38
 
37
export const asyncLogin = (formData) => {
39
export const asyncLogin = (formData) => {
-
 
40
  return async (dispatch) => {
38
  return async (dispatch) => {
41
    const url = ENV === 'production' ? '/signin' : '/signin/debug';
Línea 39... Línea 42...
39
    const response = await axios.post('/signin/debug', formData);
42
    const response = await axios.post(url, formData);
40
 
43
 
41
    const { success, data } = response.data;
44
    const { success, data } = response.data;