From aa8e020df63415b3fa2a5095c0a81b9ab82547c2 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski <ilija.la@live.com> Date: Thu, 4 Aug 2022 11:57:09 +0200 Subject: [PATCH] UI: Use AuthComponent in VersionComponent --- .../cc/ui/src/components/logo/VersionComponent.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/logo/VersionComponent.js b/monkey/monkey_island/cc/ui/src/components/logo/VersionComponent.js index 10dbd0bf0..34d164f4a 100644 --- a/monkey/monkey_island/cc/ui/src/components/logo/VersionComponent.js +++ b/monkey/monkey_island/cc/ui/src/components/logo/VersionComponent.js @@ -2,8 +2,9 @@ import React from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faDownload } from '@fortawesome/free-solid-svg-icons/faDownload'; +import AuthComponent from '../AuthComponent'; -class VersionComponent extends React.Component { +class VersionComponent extends AuthComponent { constructor(props) { super(props); this.state = { @@ -14,7 +15,7 @@ class VersionComponent extends React.Component { } componentDidMount() { - fetch('/api/island/version') // This is not authenticated on purpose + this.authFetch('/api/island/version') // This is not authenticated on purpose .then(res => res.json()) .then(res => { this.setState({ @@ -27,6 +28,7 @@ class VersionComponent extends React.Component { newerVersionAvailable() { const semverGt = require('semver/functions/gt'); + console.log(this.state); if(this.state.latestVersion !== undefined && this.state.versionNumber !== undefined) { return semverGt(this.state.latestVersion, this.state.versionNumber); }