import { USER_LOGGED_IN, USER_LOGGED_OUT, REQUEST_LOGIN, REQUEST_LOGIN_FAILURE,
  REQUEST_OAUTH_LOGIN, REQUEST_OAUTH_LOGIN_FAILURE,
  REQUEST_LOGOUT,
  REQUEST_REGISTER, REQUEST_REGISTER_FAILURE
} from "../types";

export const requestLogin = data => ({
  type: REQUEST_LOGIN,
  data
});

export const userLoggedIn = user => ({
  type: USER_LOGGED_IN,
  user
});

export const requestLogout = data => ({
  type: REQUEST_LOGOUT,
});

export const userLoggedOut = () => ({
  type: USER_LOGGED_OUT
});


export const requestLoginFailure = errors => ({
  type: REQUEST_LOGIN_FAILURE,
  errors
});

export const requestOauthLogin = () => ({
  type: REQUEST_OAUTH_LOGIN,
});

export const requestOauthLoginFailure = errors => ({
  type: REQUEST_OAUTH_LOGIN_FAILURE,
  errors
});

export const requestRegister  = data => ({
  type: REQUEST_REGISTER,
  data
});

export const requestRegisterFailure = errors => ({
  type: REQUEST_REGISTER_FAILURE,
  errors
});
