added domain to config
This commit is contained in:
parent
2824968dc3
commit
44ada32d60
@ -19,6 +19,7 @@ import (
|
|||||||
|
|
||||||
var secret []byte
|
var secret []byte
|
||||||
var method string
|
var method string
|
||||||
|
var DOMAIN string
|
||||||
|
|
||||||
type Connection struct {
|
type Connection struct {
|
||||||
DatabaseConnection *mongo.Client
|
DatabaseConnection *mongo.Client
|
||||||
@ -222,7 +223,7 @@ func (con Connection) verify(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Redirect(303, "http://%s/login")
|
c.Redirect(303, fmt.Sprintf("http://%s/login", DOMAIN))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (con Connection) ServerAuthorized(permissions models.Permission) func(*gin.Context) bool {
|
func (con Connection) ServerAuthorized(permissions models.Permission) func(*gin.Context) bool {
|
||||||
@ -260,6 +261,7 @@ func LoadGroup(group *gin.RouterGroup, client *mongo.Client, config models.Globa
|
|||||||
|
|
||||||
secret = []byte(config.Key)
|
secret = []byte(config.Key)
|
||||||
method = config.Algorithm
|
method = config.Algorithm
|
||||||
|
DOMAIN = config.Domain
|
||||||
|
|
||||||
group.POST("/signin", connection.signIn)
|
group.POST("/signin", connection.signIn)
|
||||||
group.POST("/signup", AuthorizedTo(models.Admin), connection.signUp)
|
group.POST("/signup", AuthorizedTo(models.Admin), connection.signUp)
|
||||||
|
@ -11,4 +11,5 @@ type GlobalConfig struct {
|
|||||||
Email EmailConfig
|
Email EmailConfig
|
||||||
Key string
|
Key string
|
||||||
Algorithm string
|
Algorithm string
|
||||||
|
Domain string
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
|
|
||||||
const FILE_BROWSER_IMAGE = "filebrowser/filebrowser:latest"
|
const FILE_BROWSER_IMAGE = "filebrowser/filebrowser:latest"
|
||||||
|
|
||||||
var DOMAIN = os.Getenv("SERVER_DOMAIN")
|
var DOMAIN string = ""
|
||||||
|
|
||||||
type Connection struct {
|
type Connection struct {
|
||||||
databaseConnection *mongo.Client
|
databaseConnection *mongo.Client
|
||||||
@ -797,6 +797,8 @@ func LoadGroup(group *gin.RouterGroup, mongo_client *mongo.Client, config models
|
|||||||
}
|
}
|
||||||
defer apiClient.Close()
|
defer apiClient.Close()
|
||||||
|
|
||||||
|
DOMAIN = config.Domain
|
||||||
|
|
||||||
connection := Connection{databaseConnection: mongo_client, dockerClient: apiClient}
|
connection := Connection{databaseConnection: mongo_client, dockerClient: apiClient}
|
||||||
authConnection := auth.Connection{DatabaseConnection: mongo_client}
|
authConnection := auth.Connection{DatabaseConnection: mongo_client}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user