refactor: rework redirects and history storage

This commit is contained in:
Stavros
2025-09-01 18:01:45 +03:00
parent 0c18a64466
commit c80c37ba69
9 changed files with 51 additions and 17 deletions

View File

@@ -1,6 +1,8 @@
package controller
import (
"fmt"
"net/url"
"tinyauth/internal/utils"
"github.com/gin-gonic/gin"
@@ -34,7 +36,6 @@ type AppContextResponse struct {
type ContextControllerConfig struct {
ConfiguredProviders []string
DisableContinue bool
Title string
GenericName string
AppURL string
@@ -90,13 +91,15 @@ func (controller *ContextController) userContextHandler(c *gin.Context) {
}
func (controller *ContextController) appContextHandler(c *gin.Context) {
appUrl, _ := url.Parse(controller.Config.AppURL) // no need to check error, validated on startup
c.JSON(200, AppContextResponse{
Status: 200,
Message: "Success",
ConfiguredProviders: controller.Config.ConfiguredProviders,
Title: controller.Config.Title,
GenericName: controller.Config.GenericName,
AppURL: controller.Config.AppURL,
AppURL: fmt.Sprintf("%s://%s", appUrl.Scheme, appUrl.Host),
RootDomain: controller.Config.RootDomain,
ForgotPasswordMessage: controller.Config.ForgotPasswordMessage,
BackgroundImage: controller.Config.BackgroundImage,