Skip to content

Commit 90cfe12

Browse files
committed
auto logout
1 parent 521f740 commit 90cfe12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/src/Pages/CardsPage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ function CardsPage() {
7676

7777
/** очистка оштбок хука запросов и запись ошибки в сообщение*/
7878
React.useEffect(() => {
79-
if (error) setMessage([error, false])
79+
if (error) setMessage(error)
80+
/**Выйти в случае неавторизации */
81+
if (error === 'Нет авторизации') auth.logout()
8082
clearError()
83+
// eslint-disable-next-line react-hooks/exhaustive-deps
8184
}, [error, clearError])
8285

8386
/**Массив заметок */

0 commit comments

Comments
 (0)