Skip to content

Commit e1494d8

Browse files
committed
Update users.service.ts
1 parent 1278fee commit e1494d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/services/users.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { API_URL } from "../_config/api.config";
44

55
const ENDPOINT_URL = "/users";
66

7+
function setUserInLocalStorage(user: User) {
8+
// store user details and jwt token in local storage to keep user logged in between page refreshes
9+
localStorage.setItem("user", JSON.stringify(user));
10+
}
11+
712
function login(email: string, password: string): Promise<User> {
813
const requestOptions = {
914
method: "POST",
@@ -74,11 +79,6 @@ function changePassword(password: string): Promise<boolean> {
7479
);
7580
}
7681

77-
function setUserInLocalStorage(user: User) {
78-
// store user details and jwt token in local storage to keep user logged in between page refreshes
79-
localStorage.setItem("user", JSON.stringify(user));
80-
}
81-
8282
function logout() {
8383
localStorage.removeItem("user");
8484
}

0 commit comments

Comments
 (0)