flowviz
Version:
A framework which provides seamless integration with other phylogenetic tools and frameworks, while allowing workflow scheduling and execution, through the Apache Airflow workflow system.
51 lines (44 loc) • 912 B
JavaScript
import Request from "./request";
import httpOptions from "./httpOptions";
class AuthService {
constructor(baseUrl) {
this.baseUrl = baseUrl;
}
register(body, onError, onSuccess, loading) {
return Request(
`${this.baseUrl}/register`,
httpOptions.post(body),
onError,
onSuccess,
loading
);
}
login(body, onError, onSuccess, loading) {
return Request(
`${this.baseUrl}/login`,
httpOptions.post(body),
onError,
onSuccess,
loading
);
}
profile(onError, onSuccess, loading) {
return Request(
`${this.baseUrl}/profile`,
httpOptions.getAuth(),
onError,
onSuccess,
loading
);
}
logout(onError, onSuccess, loading) {
return Request(
`${this.baseUrl}/logout`,
httpOptions.post,
onError,
onSuccess,
loading
);
}
}
export default AuthService;