<?php

namespace Origo\Controller;

use Origo\Controller\ControllerBase;
use Origo\Controller\ControllerInterface;
use Origo\Services\Template;

class MainController extends ControllerBase implements ControllerInterface {

  public function __construct() {
    parent::__construct();
  }

  /**
   * Get the response.
   */ 
  public function getResponse(): string {
    $session_id = $this->request->getCookie('ORIGOSESS');
    if($session_id) {
      header("Location: /dashboard");
      die();
    }
    $template = new Template('main.html');

    return $template->render();
  }

}
