Skip to content

Commit

Permalink
Added redirect for unauthenticated api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed May 26, 2021
1 parent c4d5e8d commit 48841fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ui/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
};
Expand Down

0 comments on commit 48841fa

Please sign in to comment.