From 8ddcbc49554879052bec94e7149ec66431db93a1 Mon Sep 17 00:00:00 2001 From: Radical Date: Thu, 29 May 2025 18:36:07 +0200 Subject: [PATCH] feat: add registration_enabled and email_verification_required fields to stats --- src/api/v1/stats.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/api/v1/stats.rs b/src/api/v1/stats.rs index 4e8aa32..bf2bec3 100644 --- a/src/api/v1/stats.rs +++ b/src/api/v1/stats.rs @@ -18,6 +18,8 @@ struct Response { accounts: i64, uptime: u64, version: String, + registration_enabled: bool, + email_verification_required: bool, build_number: String, } @@ -31,6 +33,8 @@ struct Response { /// "accounts": 3, /// "uptime": 50000, /// "version": "0.1.0", +/// "registration_enabled": true, +/// "email_verification_required": true, /// "build_number": "39d01bb" /// }); /// ``` @@ -50,6 +54,8 @@ pub async fn res(data: web::Data) -> Result { .expect("Seriously why dont you have time??") .as_secs(), version: String::from(VERSION.unwrap_or("UNKNOWN")), + registration_enabled: data.config.instance.registration, + email_verification_required: data.config.instance.require_email_verification, // TODO: Get build number from git hash or remove this from the spec build_number: String::from("how do i implement this?"), };