refactor: Auth

This commit is contained in:
Anoop M D
2022-03-08 02:22:21 +05:30
parent aa98cfe86e
commit 5683298deb
7 changed files with 29 additions and 24 deletions

13
renderer/api/auth.js Normal file
View File

@@ -0,0 +1,13 @@
import { get, post, put } from './base';
const AuthApi = {
whoami: () =>get('auth/v1/user/whoami'),
signup: (params) =>post('auth/v1/user/signup', params),
login: (params) =>post('auth/v1/user/login', params),
signout: () => post('auth/v1/user/logout'),
getProfile: () =>get('auth/v1/user/profile'),
updateProfile: (params) =>put('auth/v1/user/profile', params),
updateUsername: (params) =>put('auth/v1/user/username', params)
};
export default AuthApi;