feat: add version information to login screen

This commit is contained in:
Stavros
2025-07-12 00:08:24 +03:00
parent a11aba72d8
commit d0be4a2654
10 changed files with 104 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"strings"
"time"
"tinyauth/internal/auth"
"tinyauth/internal/constants"
"tinyauth/internal/docker"
"tinyauth/internal/hooks"
"tinyauth/internal/providers"
@@ -565,6 +566,9 @@ func (h *Handlers) AppHandler(c *gin.Context) {
ForgotPasswordMessage: h.Config.ForgotPasswordMessage,
BackgroundImage: h.Config.BackgroundImage,
OAuthAutoRedirect: h.Config.OAuthAutoRedirect,
Version: constants.Version,
BuildTimestamp: constants.BuildTimestamp,
CommitHash: constants.CommitHash,
}
// Return app context

View File

@@ -218,6 +218,9 @@ func TestAppContext(t *testing.T) {
BackgroundImage: "https://example.com/image.png",
OAuthAutoRedirect: "none",
Domain: "localhost",
Version: "development",
BuildTimestamp: "n/a",
CommitHash: "n/a",
}
// We should get the username back

View File

@@ -54,6 +54,9 @@ type AppContext struct {
ForgotPasswordMessage string `json:"forgotPasswordMessage"`
BackgroundImage string `json:"backgroundImage"`
OAuthAutoRedirect string `json:"oauthAutoRedirect"`
Version string `json:"version"`
BuildTimestamp string `json:"buildTimestamp"`
CommitHash string `json:"commitHash"`
}
// Totp request is the request for the totp endpoint