From 48841fa5aaa231810881da9a4927703c25486360 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 26 May 2021 15:07:03 -0700 Subject: [PATCH] Added redirect for unauthenticated api calls --- ui/src/app/App.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/src/app/App.js b/ui/src/app/App.js index db7a0dbbd..b9bb95ea6 100644 --- a/ui/src/app/App.js +++ b/ui/src/app/App.js @@ -30,11 +30,19 @@ import { Contention } from './metadata/contention/ContentionContext'; function App() { const httpOptions = { + redirect: 'manual', interceptors: { request: async ({options, url, path, route}) => { options.headers['X-XSRF-TOKEN'] = get_cookie('XSRF-TOKEN'); return options; + }, + response: async ({response}) => { + if (response.type === "opaqueredirect") { + window.location.reload(); + } else { + return response; + } } } };