import HttpRequest from '@/resources/axios/core/http-request'

class AuthProvider extends HttpRequest {
  constructor () {
    super(process.env.VUE_APP_RESTAPI)
  }

  getCsrfToken = (payload, config) => this.get('/get_csrf_token', { payload }, config)
    .catch((err) => this.handleError(err))

  logout = (payload, config) => this.delete2(
    '/users/sign_out',
    { payload },
    config
  )
}

export default new AuthProvider()
