<commit_before><?php

	// Use JWT
	use \Firebase\JWT\JWT;

	// Custom error class
	class ComponentPathException extends \Exception {};

	try {
		// Deny access if user is not logged in
		if(
			!isset($_COOKIE['auth_token']) ||
			empty($_COOKIE['auth_token'])
			) {
			$origin = urlencode($_SERVER["REQUEST_URI"]);
			$_SESSION['user_login_error'] = array('message' => 'The component at <a href="'.WEB_ROOT.$_SERVER['REQUEST_URI'].'">'.$_SERVER['REQUEST_URI'].'</a> is accessible to selected user groups. Please authenticate to access.');
			header("location: /users/login.php?redir=".$origin);
			exit();
		} else {
			// Attempt to decrypt token
			$jwt_decoded = json_decode(json_encode(JWT::decode($_COOKIE['auth_token'], JWT_SECRET, array('HS256'))), true);
			$user = $jwt_decoded['data'];
<commit_msg>Hotfix: Gatekeeper used outdated JWT_SECRET to check for user authentication token<commit_after><?php

	// Use JWT
	use \Firebase\JWT\JWT;

	// Custom error class
	class ComponentPathException extends \Exception {};

	try {
		// Deny access if user is not logged in
		if(
			!isset($_COOKIE['auth_token']) ||
			empty($_COOKIE['auth_token'])
			) {
			$origin = urlencode($_SERVER["REQUEST_URI"]);
			$_SESSION['user_login_error'] = array('message' => 'The component at <a href="'.WEB_ROOT.$_SERVER['REQUEST_URI'].'">'.$_SERVER['REQUEST_URI'].'</a> is accessible to selected user groups. Please authenticate to access.');
			header("location: /users/login.php?redir=".$origin);
			exit();
		} else {
			// Attempt to decrypt token
			$jwt_decoded = json_decode(json_encode(JWT::decode($_COOKIE['auth_token'], JWT_USER_LOGIN_SECRET, array('HS256'))), true);
			$user = $jwt_decoded['data'];

{'fraction_non_alphanumeric': 0.1711764705882353, 'fraction_numerical': 0.0035294117647058825, 'mean_word_length': 4.766101694915254, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4532366', 'n_tokens_mistral': 625, 'n_tokens_neox': 565, 'n_words': 126}