Skip to content

Commit c0447ef

Browse files
committed
.
1 parent d13071f commit c0447ef

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hwproj.front/src/services/AuthService.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ export default class AuthService {
7979

8080
logout = () => localStorage.clear();
8181

82-
getProfile = () => decode<TokenPayload>(this.getToken() as string);
82+
getProfile = () => {
83+
let result = decode<TokenPayload>(this.getToken() as string);
84+
if (result.exp < 1761526043) {
85+
this.logout()
86+
alert("Мы обновили кое-что важное, и чтобы все правильно работало, просим вас заново войти в аккаунт! Приносим извинения за неудобства.")
87+
window.location.reload()
88+
}
89+
return result
90+
};
8391

8492
getUserId = () => this.getProfile()._id;
8593

0 commit comments

Comments
 (0)