Skip to content

Commit

Permalink
Remove API lang cookie (#259)
Browse files Browse the repository at this point in the history
* Remove checking the cookie in the server
* Fix language determination in the webclient
* Remove cookie from API documentation

Co-authored-by: Frank Elsinga <[email protected]>
  • Loading branch information
CommanderStorm committed Nov 7, 2022
1 parent 4faa2bd commit 238fa22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webclient/src/utils/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export function useFetch<T>(
const data = shallowRef<T | null>(null);
// for some of our endpoints, we might want to have access to the lang/theme cookies

options.credentials = "same-origin";
// Add language query param to the request
const lang = document.documentElement.lang;
url += (url.indexOf("?") != -1 ? "&lang=" : "?lang=") + lang;

const global = useGlobalStore();
fetch(url, options)
.then((res) => {
Expand Down

0 comments on commit 238fa22

Please sign in to comment.