diff mod_http_oauth2/mod_http_oauth2.lua @ 6408:7fe484e7b574

mod_http_oauth2: Make error template optional Would fall back to mod_http_errors
author Kim Alvefur <zash@zash.se>
date Wed, 18 Feb 2026 16:35:30 +0100
parents 3f0970babd67
children ff55e93be449
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Wed Feb 18 16:34:37 2026 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Wed Feb 18 16:35:30 2026 +0100
@@ -102,7 +102,7 @@
 	consent = read_file(template_path, "consent.html", true);
 	oob = read_file(template_path, "oob.html", true);
 	device = read_file(template_path, "device.html", true);
-	error = read_file(template_path, "error.html", true);
+	error = read_file(template_path, "error.html");
 	css = read_file(template_path, "style.css");
 	js = read_file(template_path, "script.js");
 };
@@ -807,6 +807,7 @@
 end
 
 local function render_error(err)
+	if not templates.error then return err or 500; end
 	return render_page(templates.error, { error = err });
 end