Correction auto-logout
This commit is contained in:
parent
b456fe9f65
commit
3fa2b5905a
|
@ -3,8 +3,7 @@ import { put } from 'redux-saga/effects';
|
||||||
import { logout } from '../actions/logout';
|
import { logout } from '../actions/logout';
|
||||||
|
|
||||||
export function* failuresSaga(action) {
|
export function* failuresSaga(action) {
|
||||||
const err = action.error;
|
if (action.error instanceof GiteaUnauthorizedError) {
|
||||||
if (err instanceof GiteaUnauthorizedError) {
|
|
||||||
yield put(logout());
|
yield put(logout());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
export class GiteaUnauthorizedError extends Error {
|
export class GiteaUnauthorizedError extends Error {
|
||||||
constructor(...args: any[]) {
|
constructor(...args: any[]) {
|
||||||
super(...args)
|
super(...args)
|
||||||
|
Object.setPrototypeOf(this, GiteaUnauthorizedError.prototype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue