bruno/renderer/api/auth.js
2022-09-28 02:25:05 +05:30

22 lines
651 B
JavaScript

import { get, post, put } from './base';
// not used. kept as a placeholder for reference while implementing license key stuff
const AuthApi = {
whoami: () => get('auth/v1/user/whoami'),
signup: (params) => post('auth/v1/user/signup', params),
login: (params) => {
return new Promise((resolve, reject) => {
const { ipcRenderer } = window.require("electron");
ipcRenderer.invoke('grafnode-account-request', {
data: params,
method: 'POST',
url: `${process.env.NEXT_PUBLIC_GRAFNODE_SERVER_API}/auth/v1/user/login`,
})
.then(resolve)
.catch(reject);
});
}
};
export default AuthApi;