Skip to content

Commit be7ba60

Browse files
committed
Add auth logic
1 parent 900774c commit be7ba60

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

frontend/src/services/userService/userService.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function login(username, password) {
1414
body: JSON.stringify({ username, password })
1515
};
1616

17-
return fetch('http://localhost:3000/users/authenticate', requestOptions)
17+
return fetch('http://localhost:7777/user/authenticate', requestOptions)
1818
.then(handleResponse)
1919
.then(user => {
2020
// login successful if there's a jwt token in the response
@@ -38,21 +38,17 @@ function getAll() {
3838
headers: authHeader()
3939
};
4040

41-
return fetch('http://localhost:3000/users', requestOptions).then(handleResponse);
41+
return fetch('http://localhost:7777/users', requestOptions).then(handleResponse);
4242
}
4343

4444
function getUserDetailed(userId) {
4545
const requestOptions = {
46-
<<<<<<< HEAD
47-
method: 'POST',
48-
=======
4946
method: 'GET',
50-
>>>>>>> 2d0f897a19bafd5cd48b436f3e72cce3864d0c25
5147
headers: authHeader(),
5248
body: JSON.stringify({ userId })
5349
};
5450

55-
return fetch('http://localhost:3000/user', requestOptions).then(handleResponse);
51+
return fetch('http://localhost:7777/user', requestOptions).then(handleResponse);
5652
}
5753

5854
function handleResponse(response) {

0 commit comments

Comments
 (0)