mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
0e08a6e698
* API client sends reset password requests * ResetPasswordPage actions and reducer * Reset password happy path
30 lines
838 B
JavaScript
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();
|