2019-12-01 22:12:13 +01:00
|
|
|
import { GiteaUnauthorizedError } from "../../util/gitea";
|
|
|
|
import { put } from 'redux-saga/effects';
|
2019-12-13 15:48:58 +01:00
|
|
|
import { logout } from '../actions/logout';
|
2020-05-19 22:22:37 +02:00
|
|
|
import { saveReferer } from "../../util/referer";
|
2019-11-28 14:12:48 +01:00
|
|
|
|
2019-12-01 22:12:13 +01:00
|
|
|
export function* failuresSaga(action) {
|
2020-05-06 11:30:26 +02:00
|
|
|
if (action.error instanceof GiteaUnauthorizedError) {
|
2020-05-19 22:22:37 +02:00
|
|
|
saveReferer();
|
2019-12-13 14:21:20 +01:00
|
|
|
yield put(logout());
|
2019-12-01 22:12:13 +01:00
|
|
|
}
|
2019-11-28 14:12:48 +01:00
|
|
|
}
|