fix: allow refresh tokens in AuthMiddleware for refresh route and dispatch auth_error on 401s to force login redirect
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m23s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m23s
This commit is contained in:
parent
4c8e6b814c
commit
fbad71cbf2
3 changed files with 19 additions and 2 deletions
|
|
@ -13,6 +13,13 @@ export default function Home() {
|
|||
|
||||
useEffect(() => {
|
||||
checkState();
|
||||
|
||||
const handleAuthError = () => {
|
||||
api.clearTokens();
|
||||
setState('login');
|
||||
};
|
||||
window.addEventListener('auth_error', handleAuthError);
|
||||
return () => window.removeEventListener('auth_error', handleAuthError);
|
||||
}, []);
|
||||
|
||||
async function checkState() {
|
||||
|
|
|
|||
Reference in a new issue