<?php

namespace IPS\forumfortress;

use IPS\Application as SystemApplication;
use IPS\forumfortress\Api\Client;
use IPS\Settings;
use Throwable;

if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

class Application extends SystemApplication
{
	public function init() : void
	{
		if ( Settings::i()->ff_enabled )
		{
			try
			{
				Client::ensureIdentity();
			}
			catch ( Throwable $e )
			{
			}
		}
	}
}
