From d1e7d7bf27e25405b6fcdd485e5aa1a3aeb46265 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Tue, 9 Nov 2021 22:24:46 +0100 Subject: Add login system --- src/services/AuthService.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/services/AuthService.js (limited to 'src/services') diff --git a/src/services/AuthService.js b/src/services/AuthService.js new file mode 100644 index 0000000..626a8fb --- /dev/null +++ b/src/services/AuthService.js @@ -0,0 +1,17 @@ +import axios from "axios"; + +const url = 'http://localhost:8000/api/auth/' + +export default { + async login(data) { + return await axios + .post(url+'login/', data) + .then(res => res.data) + }, + + async register(data) { + return await axios + .post(url+'register/', data) + .then(res => res.data) + } +} \ No newline at end of file -- cgit v1.2.3