1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-25 16:19:47 +02:00

feat: Automatic logout when session expires
Some checks are pending
Build and push Docker DEV image / build ([self-hosted arm64], linux/arm/v7) (push) Waiting to run
Build and push Docker DEV image / build ([self-hosted arm64], linux/arm64) (push) Waiting to run
Build and push Docker DEV image / build ([self-hosted x64], linux/amd64) (push) Waiting to run
Build and push Docker DEV image / merge (push) Blocked by required conditions
Build and push Docker DEV image / rerun-failed-jobs (push) Blocked by required conditions

Closes #693
This commit is contained in:
Maksim Eltyshev 2024-04-09 15:12:46 +02:00
parent b46fb43e6f
commit 4e2863faa7
15 changed files with 130 additions and 42 deletions

View file

@ -1,10 +1,12 @@
import { call, put, select, take } from 'redux-saga/effects';
import { push } from '../../../lib/redux-router';
import { logout } from './core';
import request from '../request';
import selectors from '../../../selectors';
import actions from '../../../actions';
import api from '../../../api';
import { getAccessToken } from '../../../utils/access-token-storage';
import ActionTypes from '../../../constants/ActionTypes';
import Paths from '../../../constants/Paths';
@ -25,6 +27,13 @@ export function* goToCard(cardId) {
}
export function* handleLocationChange() {
const accessToken = yield call(getAccessToken);
if (!accessToken) {
yield call(logout, false);
return;
}
const pathsMatch = yield select(selectors.selectPathsMatch);
if (!pathsMatch) {