diff --git a/src/components/app/app.ts b/src/components/app/app.ts index 5449641..befe5f3 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -5,6 +5,7 @@ import Overall from '@/pages/overall/overall'; import Constants from '@/constants'; import JsonUtils from '@/utils/json-utils'; import pWaitFor from 'p-wait-for'; +import {HttpUtils} from '@/utils/http-utils'; /** * Objects of this interface represent assignment grades. @@ -55,6 +56,9 @@ export default class App extends Vue // Token public token: string = ''; + // Http Client + public http: HttpUtils = new HttpUtils(''); + /** * This is called when the instance is created. */ @@ -77,6 +81,9 @@ export default class App extends Vue // Store token this.token = token; + // Assign token to http client + this.http.token = token; + // Load data this.loadCoursesAfterLogin(); } diff --git a/src/utils/http-utils.ts b/src/utils/http-utils.ts index 6e03f25..ac00b72 100644 --- a/src/utils/http-utils.ts +++ b/src/utils/http-utils.ts @@ -2,7 +2,7 @@ import Constants from '@/constants'; export class HttpUtils { - private token: string = ''; + public token: string = ''; constructor (token: string) {