diff --git a/apps/web/src/app/app.tsx b/apps/web/src/app/app.tsx
index 70e28b387d6d59eea0821d1ef2883adb6cd8d236..4f787f5b96c25f096829a7f3b2ca4a2038e85932 100644
--- a/apps/web/src/app/app.tsx
+++ b/apps/web/src/app/app.tsx
@@ -41,7 +41,7 @@ import { addError } from '@graphpolaris/shared/lib/data-access/store/configSlice
 export interface App {}
 
 export function App(props: App) {
-  const isLogin = useAuth();
+  const { login } = useAuth();
   const auth = useAuthorizationCache();
   const api = useDatabaseAPI();
   const api_schema = useSchemaAPI();
@@ -70,6 +70,8 @@ export function App(props: App) {
       Broker.instance().subscribe((data: LinkPredictionInstance[]) => dispatch(setMLResult({ type: mlType, result: data })), mlType);
     });
 
+    login();
+
     return () => {
       Broker.instance().unSubscribeAll('schema_result');
       Broker.instance().unSubscribeAll('query_result');
@@ -82,7 +84,7 @@ export function App(props: App) {
   useEffect(() => {
     // New active database
     if (auth.jwt && session.currentDatabase) {
-      ws.current.useToken(auth.jwt).connect(() => {
+      ws.current.useAuth(auth).connect(() => {
         api_schema.RequestSchema(session.currentDatabase);
       });
     }
@@ -90,9 +92,8 @@ export function App(props: App) {
 
   useEffect(() => {
     // Newly (un)authorized
-    // console.log('Auth changed', auth.authorized, isLogin);
     if (auth.authorized) {
-      console.debug('App is authorized; Getting Databases', isLogin);
+      console.debug('App is authorized; Getting Databases', auth.authorized);
       api.GetAllDatabases({ updateSessionCache: true }).catch((e) => {
         dispatch(addError(e.message));
       });
diff --git a/libs/shared/lib/data-access/api/database.ts b/libs/shared/lib/data-access/api/database.ts
index 371a823426f76889c4d8c2405df244e34ddf7f8c..f05ab32460ce874d09b0a8df95320f825e041e8e 100644
--- a/libs/shared/lib/data-access/api/database.ts
+++ b/libs/shared/lib/data-access/api/database.ts
@@ -1,7 +1,7 @@
 // All database related API calls
 
-import { fetchSettings } from '../authorization';
-import { useAppDispatch, useAuthorizationCache, useSessionCache } from '../store';
+import { useAuth } from '../authorization';
+import { useAppDispatch, useSessionCache } from '../store';
 import { updateCurrentDatabase, updateDatabaseList } from '../store/sessionSlice';
 
 export enum DatabaseType {
@@ -41,12 +41,12 @@ export const useDatabaseAPI = () => {
   const dispatch = useAppDispatch();
   const domain = import.meta.env.BACKEND_URL;
   const useruri = import.meta.env.BACKEND_USER;
+  const { fetchAuthenticated } = useAuth();
 
   function AddDatabase(request: AddDatabaseRequest, options: AddDatabaseOptions = {}): Promise<void> {
     const { setAsCurrent = true, updateDatabaseCache = false } = options;
     return new Promise((resolve, reject) => {
-      fetch(`${domain}${useruri}/database`, {
-        ...fetchSettings,
+      fetchAuthenticated(`${domain}${useruri}/database`, {
         method: 'POST',
         body: JSON.stringify(request),
       })
@@ -68,7 +68,8 @@ export const useDatabaseAPI = () => {
   function GetAllDatabases(options: GetDatabasesOptions = {}): Promise<Array<string>> {
     const { updateSessionCache: updateDatabaseCache = true } = options;
     return new Promise((resolve, reject) => {
-      fetch(`${domain}${useruri}/database`, fetchSettings)
+      // fetch(`${domain}${useruri}/database`)
+      fetchAuthenticated(`${domain}${useruri}/database`)
         .then((response: Response) => {
           if (!response.ok) {
             new Promise((resolve, reject) => {
@@ -90,8 +91,7 @@ export const useDatabaseAPI = () => {
   function DeleteDatabase(name: string, options: DeleteDatabasesOptions = {}): Promise<void> {
     const { updateSessionCache: updateDatabaseCache = true } = options;
     return new Promise((resolve, reject) => {
-      fetch(`${domain}${useruri}/database/` + name, {
-        ...fetchSettings,
+      fetchAuthenticated(`${domain}${useruri}/database/` + name, {
         method: 'DELETE',
       })
         .then((response: Response) => {
@@ -109,8 +109,7 @@ export const useDatabaseAPI = () => {
 
   function TestDatabaseConnection(request: AddDatabaseRequest): Promise<void> {
     return new Promise((resolve, reject) => {
-      fetch(`${domain}${useruri}/database/test-connection`, {
-        ...fetchSettings,
+      fetchAuthenticated(`${domain}${useruri}/database/test-connection`, {
         method: 'POST',
         body: JSON.stringify(request),
       })
diff --git a/libs/shared/lib/data-access/api/query.ts b/libs/shared/lib/data-access/api/query.ts
index b7c146074d0154b243dd6624a5c2e2f62434b603..29e6752f1bc14b30a645b65d5b67211a014edf6b 100644
--- a/libs/shared/lib/data-access/api/query.ts
+++ b/libs/shared/lib/data-access/api/query.ts
@@ -1,16 +1,16 @@
 // All database related API calls
 
 import { BackendQueryFormat } from '../../querybuilder/model/BackendQueryFormat';
-import { fetchSettings } from '../authorization';
+import { useAuth } from '../authorization';
 import { useAuthorizationCache, useSessionCache } from '../store';
 
 export const useQueryAPI = () => {
   const domain = import.meta.env.BACKEND_URL;
   const query_url = import.meta.env.BACKEND_QUERY;
+  const { fetchAuthenticated } = useAuth();
 
   async function execute(query: BackendQueryFormat) {
-    const response = await fetch(`${domain}${query_url}/execute`, {
-      ...fetchSettings,
+    const response = await fetchAuthenticated(`${domain}${query_url}/execute`, {
       method: 'POST',
       body: JSON.stringify(query),
     });
@@ -26,8 +26,7 @@ export const useQueryAPI = () => {
 
   async function retrieveCachedQuery(queryID: string) {
     // TODO: check if this method is needed!
-    // const response = await fetch(`${domain}/query/retrieve-cached/`, {
-    //     ...fetchSettings,
+    // const response = await fetchAuthenticated(`${domain}/query/retrieve-cached/`, {
     //     method: 'POST',
     //     body: JSON.stringify({ queryID })
     // });
diff --git a/libs/shared/lib/data-access/api/schema.ts b/libs/shared/lib/data-access/api/schema.ts
index df83d5d0530385709f47a1c049c70dde35a69eed..c310676c3c8a56355b980f75cc90a3b453867f1f 100644
--- a/libs/shared/lib/data-access/api/schema.ts
+++ b/libs/shared/lib/data-access/api/schema.ts
@@ -1,12 +1,13 @@
 // All database related API calls
 
-import { fetchSettings } from '../authorization';
-import { useAuthorizationCache, useSessionCache } from '../store';
+import { useAuth } from '../authorization';
+import { useSessionCache } from '../store';
 
 export const useSchemaAPI = () => {
   const cache = useSessionCache();
   const domain = import.meta.env.BACKEND_URL;
   const schema = import.meta.env.BACKEND_SCHEMA;
+  const { fetchAuthenticated } = useAuth();
 
   async function RequestSchema(databaseName?: string) {
     if (!databaseName) databaseName = cache.currentDatabase;
@@ -20,8 +21,7 @@ export const useSchemaAPI = () => {
       // cached: true,
     };
 
-    const response = await fetch(`${domain}${schema}`, {
-      ...fetchSettings,
+    const response = await fetchAuthenticated(`${domain}${schema}`, {
       method: 'POST',
       body: JSON.stringify(request),
     });
diff --git a/libs/shared/lib/data-access/authorization/useAuth.tsx b/libs/shared/lib/data-access/authorization/useAuth.tsx
index 76cff7da8bb301e5ee3daa47b71cb6cf51dd43eb..09ed2f1aeb831bd71852c6e7982f5ededacf4ee4 100644
--- a/libs/shared/lib/data-access/authorization/useAuth.tsx
+++ b/libs/shared/lib/data-access/authorization/useAuth.tsx
@@ -1,10 +1,10 @@
 import Keycloak from 'keycloak-js';
 import { useEffect, useRef, useState } from 'react';
-import { useAppDispatch } from '../store';
+import { useAppDispatch, useAuthorizationCache } from '../store';
 
 import { authorized } from '../store/authSlice';
 
-type AuthenticationHeader = {
+export type AuthenticationHeader = {
   sessionData: {
     userID: string;
     sessionID: string;
@@ -22,13 +22,12 @@ export const fetchSettings: RequestInit = {
 };
 
 export const useAuth = () => {
-  const [isLogin, setLogin] = useState(false);
   const dispatch = useAppDispatch();
+  const auth = useAuthorizationCache();
 
   const handleError = (err: any) => {
     if (import.meta.env.SKIP_LOGIN) {
       console.warn('skipping login');
-      setLogin(true);
       dispatch(
         authorized({
           userID: 'UserID',
@@ -39,18 +38,16 @@ export const useAuth = () => {
       );
       return;
     } else {
-      setLogin(false);
       console.error(err);
     }
   };
 
-  useEffect(() => {
+  const login = () => {
     fetch(`${domain}${useruri}/headers`, fetchSettings)
       .then((res) =>
         res
           .json()
           .then((res: AuthenticationHeader) => {
-            setLogin(true);
             dispatch(
               authorized({
                 userID: res.sessionData.userID,
@@ -63,9 +60,27 @@ export const useAuth = () => {
           .catch(handleError)
       )
       .catch(handleError);
-  }, []);
+  };
+
+  const fetchAuthenticated = (input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response> => {
+    if (!init) init = fetchSettings;
+
+    init.credentials = 'include';
+    init.redirect = 'follow';
+    init.method = init.method || 'GET';
+    init.headers = {
+      'Content-Type': 'application/json',
+      Userid: auth.userID || '',
+      // Userid: 'asdasd',
+      Sessionid: auth.sessionID || '',
+      Authorization: `Bearer ${auth.jwt}`,
+      ...init.headers,
+    };
+
+    return fetch(input, init);
+  };
 
-  return isLogin;
+  return { login, fetchAuthenticated };
 };
 
 // export useAuth;
diff --git a/libs/shared/lib/data-access/socket/backend-message-receiver/WebSocketHandler.tsx b/libs/shared/lib/data-access/socket/backend-message-receiver/WebSocketHandler.tsx
index d61e843a267060afeffa51b33b5bd0c537fcbea5..203e56bbb2ca0994378bb46b26acd662a6049882 100644
--- a/libs/shared/lib/data-access/socket/backend-message-receiver/WebSocketHandler.tsx
+++ b/libs/shared/lib/data-access/socket/backend-message-receiver/WebSocketHandler.tsx
@@ -4,6 +4,8 @@
  * © Copyright Utrecht University (Department of Information and Computing Sciences)
  */
 
+import { AuthenticationHeader } from '../..';
+import { UseIsAuthorizedState } from '../../store/authSlice';
 import Broker from '../broker';
 import BackendMessageReceiver from './BackendMessageReceiver';
 
@@ -12,7 +14,7 @@ export class WebSocketHandler implements BackendMessageReceiver {
   private webSocket: WebSocket | undefined;
   private url: string;
   private connected: boolean;
-  private token: string | undefined;
+  private authHeader: UseIsAuthorizedState | undefined;
 
   /** @param domain The domain to make the websocket connection with. */
   public constructor(domain: string) {
@@ -20,8 +22,8 @@ export class WebSocketHandler implements BackendMessageReceiver {
     this.connected = false;
   }
 
-  public useToken(token: string): WebSocketHandler {
-    this.token = token;
+  public useAuth(authHeader: UseIsAuthorizedState): WebSocketHandler {
+    this.authHeader = authHeader;
     return this;
   }
 
@@ -33,7 +35,11 @@ export class WebSocketHandler implements BackendMessageReceiver {
     // If there already is already a current websocket connection, close it first.
     if (this.webSocket) this.close();
 
-    this.webSocket = new WebSocket(this.url + (!!this.token ? `?jwt=${encodeURIComponent(this.token)}` : ''));
+    const params = new URLSearchParams();
+    if (this.authHeader?.sessionID) params.set('sessionID', this.authHeader?.sessionID ?? '');
+    if (this.authHeader?.userID) params.set('userID', this.authHeader?.userID ?? '');
+    if (this.authHeader?.jwt) params.set('jwt', this.authHeader?.jwt ?? '');
+    this.webSocket = new WebSocket(this.url + '?' + params.toString());
     this.webSocket.onopen = () => onOpen();
     this.webSocket.onmessage = this.onWebSocketMessage;
     this.webSocket.onerror = this.onError;
diff --git a/libs/shared/lib/data-access/socket/backend-messenger/BackendMessenger.test.tsx b/libs/shared/lib/data-access/socket/backend-messenger/BackendMessenger.test.tsx
deleted file mode 100644
index 6fe42346c20feb687ffea4b9c52d6c5e5c1639fe..0000000000000000000000000000000000000000
--- a/libs/shared/lib/data-access/socket/backend-messenger/BackendMessenger.test.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * This program has been developed by students from the bachelor Computer Science at
- * Utrecht University within the Software Project course.
- * © Copyright Utrecht University (Department of Information and Computing Sciences)
- */
-import { assert, describe, expect, it, vi } from 'vitest';
-
-import BackendMessenger from '.';
-describe('BackendMessenger', () => {
-  let placeholderDomain = 'placeholderDomain';
-  let backendMessenger = new BackendMessenger(placeholderDomain);
-
-  it('should create the the correct url ', () => {
-    expect(backendMessenger['url']).toEqual('https://' + placeholderDomain + '/');
-  });
-});
diff --git a/libs/shared/lib/data-access/socket/backend-messenger/BackendMessengerMock.tsx b/libs/shared/lib/data-access/socket/backend-messenger/BackendMessengerMock.tsx
deleted file mode 100644
index 227278531828b11b75c2416b2edcf7c8999d1fdf..0000000000000000000000000000000000000000
--- a/libs/shared/lib/data-access/socket/backend-messenger/BackendMessengerMock.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * This program has been developed by students from the bachelor Computer Science at
- * Utrecht University within the Software Project course.
- * © Copyright Utrecht University (Department of Information and Computing Sciences)
- */
-
-import BackendMessengerRepository from '../backend-message-receiver/BackendMessengerRepository';
-
-/* istanbul ignore file */
-/* The comment above was added so the code coverage wouldn't count this file towards code coverage.
- * We do not test mock implementations.
- * See testing plan for more details.*/
-
-/** Mock repository used for testing. */
-export default class BackendMessengerMock implements BackendMessengerRepository {
-  /** A mock version of the sendMessage function sends a fake message. */
-  private url: string;
-
-  /** @param domain The domain to send the messages towards. */
-  constructor(domain: string) {
-    this.url = 'https://' + domain + '/';
-  }
-  public SendMessage(body: string, requestURL: string, method: string): Promise<Response> {
-    switch (requestURL) {
-      case 'query/execute':
-        return new Promise((resolve, reject) => {
-          if (body == 'validjsonquery') resolve(this.createResponse({ queryID: 'testID' }));
-          else if (body == 'no200response') resolve(new Response(undefined, { status: 404 }));
-          else if (body == 'notvalidjsonquery') reject('invalid body');
-          else resolve(this.createResponse({ ok: 'ok' }));
-        });
-      case 'query/retrieve-cached':
-        return new Promise((resolve, reject) => {
-          const b = JSON.parse(body);
-          if ('queryID' in b) resolve(this.createResponse({}));
-          else reject('invalid body');
-        });
-      default:
-        return new Promise((resolve) => {
-          resolve(this.createResponse({ ok: 'ok' }));
-        });
-    }
-  }
-
-  /** A mock version of the sendRequest function sends a fake request. */
-  public SendRequest(requestURL: string): Promise<Response> {
-    switch (requestURL) {
-      case 'user/callback':
-        return new Promise((resolve) => {
-          const result = {
-            userID: 'mock-userID',
-          };
-          resolve(this.createResponse(result));
-        });
-
-      case 'user/session/':
-        return new Promise((resolve) => {
-          const result = {
-            userID: 'mock-userID',
-            sessionID: 'mock-sessionID',
-          };
-          resolve(this.createResponse(result));
-        });
-      case 'user/databases/':
-        return new Promise((resolve) => {
-          resolve(this.createResponse({ databases: ['testdb'] }));
-        });
-      default:
-        return new Promise((resolve) => {
-          resolve(new Response(undefined, { status: 404 }));
-        });
-    }
-  }
-
-  /** A mock response created to test the backend messenger. */
-  private createResponse(body: any): Response {
-    const meta = {
-      'Content-Type': 'application/json',
-    };
-    const headers = new Headers(meta);
-    const responseInit = { status: 200, headers: headers };
-
-    const response = new Response(JSON.stringify(body), responseInit);
-
-    return response;
-  }
-}
diff --git a/libs/shared/lib/data-access/socket/backend-messenger/index.tsx b/libs/shared/lib/data-access/socket/backend-messenger/index.tsx
deleted file mode 100644
index 1a4a638bbe687fc4cbaae3fb21b736e46d10a47f..0000000000000000000000000000000000000000
--- a/libs/shared/lib/data-access/socket/backend-messenger/index.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * This program has been developed by students from the bachelor Computer Science at
- * Utrecht University within the Software Project course.
- * © Copyright Utrecht University (Department of Information and Computing Sciences)
- */
-
-import { fetchSettings } from '../../authorization';
-import BackendMessengerRepository from '../backend-message-receiver/BackendMessengerRepository';
-
-/** Sends messages and requests to the backend. */
-export default class BackendMessenger implements BackendMessengerRepository {
-  private url: string;
-
-  /** @param domain The domain to send the messages towards. */
-  constructor(domain: string) {
-    this.url = 'https://' + domain + '/';
-  }
-
-  /**
-   * Sends a fetch request to the Datastrophe domain.
-   * @param {string} body The request body you want to send. Should be stringified JSON.
-   * @param {string} requestURL The URL you want to perform this request'.
-   * @param {string} requestMethod The method of your request. Most used are: POST, GET.
-   * @returns {Promise<void>} A promise which is resolved once a response with status 200 has been received.
-   */
-  public SendMessage(body: string, requestURL: string, requestMethod: string): Promise<Response> {
-    // Construct the URL we will request from
-    const req = this.url + requestURL;
-
-    return fetch(req, {
-      ...fetchSettings,
-      method: requestMethod,
-      headers: new Headers({
-        'Content-Type': 'application/json',
-      }),
-      // Set the body of the request, if this is not a POST request, body is set to undefined
-      body: requestMethod == 'POST' ? body : undefined,
-      // Wait for the fetch promise to resolve
-    });
-  }
-
-  /**
-   * Sendrequest sends a GET request to the backend.
-   * @param requestURL The URL you want to perform this request'.
-   * @returns {Promise<void>} A promise which is resolved once a response with status 200 has been received.
-   */
-  public SendRequest(requestURL: string): Promise<Response> {
-    // Construct the URL we will request from
-    const req = this.url + requestURL;
-    console.log('backendmessager: ' + req);
-    return fetch(req, {
-      ...fetchSettings,
-      headers: new Headers({
-        'Content-Type': 'application/json',
-      }),
-    });
-  }
-}
diff --git a/libs/shared/lib/data-access/socket/index.ts b/libs/shared/lib/data-access/socket/index.ts
index 9c9d22ab792069c516ffb61e3a1294fad5582e98..7a1661cae833d5a59bf26c67d00b23fe3a38604b 100644
--- a/libs/shared/lib/data-access/socket/index.ts
+++ b/libs/shared/lib/data-access/socket/index.ts
@@ -1,3 +1,2 @@
 export * from './backend-message-receiver';
-export * from './backend-messenger';
 export * from './broker';
diff --git a/libs/shared/lib/data-access/store/authSlice.ts b/libs/shared/lib/data-access/store/authSlice.ts
index 0632dd92ac88420fd717443be9e5d3f64ab0fdb6..663ce51a80b83dff46e2bd14e9d1eda64578a8d5 100644
--- a/libs/shared/lib/data-access/store/authSlice.ts
+++ b/libs/shared/lib/data-access/store/authSlice.ts
@@ -1,7 +1,7 @@
 import { createSlice, PayloadAction } from '@reduxjs/toolkit';
 import type { RootState } from './store';
 
-type useIsAuthorizedState = {
+export type UseIsAuthorizedState = {
   authorized: boolean | undefined;
   jwt: string | undefined;
   sessionID: string | undefined;
@@ -9,7 +9,7 @@ type useIsAuthorizedState = {
 };
 
 // Define the initial state using that type
-export const initialState: useIsAuthorizedState = {
+export const initialState: UseIsAuthorizedState = {
   authorized: undefined,
   jwt: undefined,
   sessionID: undefined,
@@ -21,22 +21,22 @@ export const authSlice = createSlice({
   // `createSlice` will infer the state type from the `initialState` argument
   initialState,
   reducers: {
-    authorized(state, action: PayloadAction<useIsAuthorizedState>) {
-      console.debug('Authorized');
+    authorized(state, action: PayloadAction<UseIsAuthorizedState>) {
+      console.info('Authorized');
       state.authorized = action.payload.authorized;
       state.jwt = action.payload.jwt;
       state.sessionID = action.payload.sessionID;
       state.userID = action.payload.userID;
     },
     logout(state) {
-      console.debug('Logging out');
+      console.info('Logging out');
       state.authorized = undefined;
       state.jwt = undefined;
       state.sessionID = undefined;
       state.userID = undefined;
     },
     unauthorized(state) {
-      console.debug('Unauthorized');
+      console.warn('Unauthorized');
       state.authorized = false;
     },
   },