From de721bd8ef90f4158007a8e8b9b9e2c431dc46f7 Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Sat, 14 Aug 2021 12:11:30 +0800 Subject: feat(core): Show version in authentication page --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/authentication_page.html | 2 +- src/main.rs | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75e2603..eb29b6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -370,7 +370,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cgit-simple-authentication" -version = "3.0.5" +version = "3.0.6" dependencies = [ "anyhow", "argon2", diff --git a/Cargo.toml b/Cargo.toml index 38ace99..a889001 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cgit-simple-authentication" -version = "3.0.5" +version = "3.0.6" authors = ["KunoiSayami <46131041+KunoiSayami@users.noreply.github.com>"] edition = "2018" diff --git a/src/authentication_page.html b/src/authentication_page.html index c62dce0..6ece746 100644 --- a/src/authentication_page.html +++ b/src/authentication_page.html @@ -1,4 +1,4 @@ -

Authentication Required

+

Authentication Requiredv{{version}}

diff --git a/src/main.rs b/src/main.rs index f960422..4b12952 100644 --- a/src/main.rs +++ b/src/main.rs @@ -244,6 +244,7 @@ async fn verify_login(cfg: &Config, data: &FormData) -> Result { pub struct Meta<'a> { action: &'a str, redirect: &'a str, + version: &'a str, } // Processing the `body` called by cgit. @@ -253,6 +254,7 @@ async fn cmd_body(matches: &ArgMatches<'_>, _cfg: Config) { let meta = Meta { action: matches.value_of("login-url").unwrap_or(""), redirect: matches.value_of("current-url").unwrap_or(""), + version: env!("CARGO_PKG_VERSION"), }; handlebars .render_template_to_write(source, &meta, std::io::stdout()) -- cgit v1.2.3