fleet/frontend/kolide/index.js
Mike Stone 0e08a6e698 Reset password page submit (#184)
* API client sends reset password requests

* ResetPasswordPage actions and reducer

* Reset password happy path
2016-09-19 11:35:38 -04:00

30 lines
838 B
JavaScript

import fetch from 'isomorphic-fetch';
import Base from './base';
import endpoints from './endpoints';
import local from '../utilities/local';
class Kolide extends Base {
loginUser ({ username, password }) {
const { LOGIN } = endpoints;
const loginEndpoint = this.baseURL + LOGIN;
return this.post(loginEndpoint, JSON.stringify({ username, password }));
}
forgotPassword ({ email }) {
const { FORGOT_PASSWORD } = endpoints;
const forgotPasswordEndpoint = this.baseURL + FORGOT_PASSWORD;
return this.post(forgotPasswordEndpoint, JSON.stringify({ email }));
}
resetPassword (formData) {
const { RESET_PASSWORD } = endpoints;
const resetPasswordEndpoint = this.baseURL + RESET_PASSWORD;
return this.post(resetPasswordEndpoint, JSON.stringify(formData));
}
}
export default new Kolide();