Skip to content

Commit 0da20a7

Browse files
author
Gareth Redfern
authored
Merge pull request #14 from garethredfern/feature/auth-service-refactor
Refactor auth to return axios response
2 parents 618ce7b + 40dfa90 commit 0da20a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/services/AuthService.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@ authClient.interceptors.response.use(
2929
export default {
3030
async login(payload) {
3131
await authClient.get("/sanctum/csrf-cookie");
32-
await authClient.post("/login", payload);
32+
return authClient.post("/login", payload);
3333
},
3434
logout() {
3535
return authClient.post("/logout");
3636
},
3737
async forgotPassword(payload) {
3838
await authClient.get("/sanctum/csrf-cookie");
39-
await authClient.post("/forgot-password", payload);
39+
return authClient.post("/forgot-password", payload);
4040
},
4141
getAuthUser() {
4242
return authClient.get("/api/users/auth");
4343
},
4444
async resetPassword(payload) {
4545
await authClient.get("/sanctum/csrf-cookie");
46-
await authClient.post("/reset-password", payload);
46+
return authClient.post("/reset-password", payload);
4747
},
4848
updatePassword(payload) {
4949
return authClient.put("/user/password", payload);
5050
},
5151
async registerUser(payload) {
5252
await authClient.get("/sanctum/csrf-cookie");
53-
await authClient.post("/register", payload);
53+
return authClient.post("/register", payload);
5454
},
5555
sendVerification(payload) {
5656
return authClient.post("/email/verification-notification", payload);

0 commit comments

Comments
 (0)