mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-27 20:25:41 +00:00
feat: add cookie domain back to context controller
This commit is contained in:
@@ -183,6 +183,7 @@ func (app *BootstrapApp) Setup() error {
|
||||
Title: app.Config.Title,
|
||||
GenericName: app.Config.GenericName,
|
||||
AppURL: app.Config.AppURL,
|
||||
CookieDomain: cookieDomain,
|
||||
ForgotPasswordMessage: app.Config.ForgotPasswordMessage,
|
||||
BackgroundImage: app.Config.BackgroundImage,
|
||||
OAuthAutoRedirect: app.Config.OAuthAutoRedirect,
|
||||
|
||||
@@ -28,6 +28,7 @@ type AppContextResponse struct {
|
||||
Title string `json:"title"`
|
||||
GenericName string `json:"genericName"`
|
||||
AppURL string `json:"appUrl"`
|
||||
CookieDomain string `json:"cookieDomain"`
|
||||
ForgotPasswordMessage string `json:"forgotPasswordMessage"`
|
||||
BackgroundImage string `json:"backgroundImage"`
|
||||
OAuthAutoRedirect string `json:"oauthAutoRedirect"`
|
||||
@@ -38,6 +39,7 @@ type ContextControllerConfig struct {
|
||||
Title string
|
||||
GenericName string
|
||||
AppURL string
|
||||
CookieDomain string
|
||||
ForgotPasswordMessage string
|
||||
BackgroundImage string
|
||||
OAuthAutoRedirect string
|
||||
@@ -98,6 +100,7 @@ func (controller *ContextController) appContextHandler(c *gin.Context) {
|
||||
Title: controller.config.Title,
|
||||
GenericName: controller.config.GenericName,
|
||||
AppURL: fmt.Sprintf("%s://%s", appUrl.Scheme, appUrl.Host),
|
||||
CookieDomain: controller.config.CookieDomain,
|
||||
ForgotPasswordMessage: controller.config.ForgotPasswordMessage,
|
||||
BackgroundImage: controller.config.BackgroundImage,
|
||||
OAuthAutoRedirect: controller.config.OAuthAutoRedirect,
|
||||
|
||||
@@ -16,6 +16,7 @@ var controllerCfg = controller.ContextControllerConfig{
|
||||
Title: "Test App",
|
||||
GenericName: "Generic",
|
||||
AppURL: "http://localhost:8080",
|
||||
CookieDomain: "localhost",
|
||||
ForgotPasswordMessage: "Contact admin to reset your password.",
|
||||
BackgroundImage: "/assets/bg.jpg",
|
||||
OAuthAutoRedirect: "google",
|
||||
@@ -61,6 +62,7 @@ func TestAppContextHandler(t *testing.T) {
|
||||
Title: controllerCfg.Title,
|
||||
GenericName: controllerCfg.GenericName,
|
||||
AppURL: controllerCfg.AppURL,
|
||||
CookieDomain: controllerCfg.CookieDomain,
|
||||
ForgotPasswordMessage: controllerCfg.ForgotPasswordMessage,
|
||||
BackgroundImage: controllerCfg.BackgroundImage,
|
||||
OAuthAutoRedirect: controllerCfg.OAuthAutoRedirect,
|
||||
|
||||
Reference in New Issue
Block a user