parent
8d2371c14e
commit
df192bed4d
|
@ -26,6 +26,7 @@ var (
|
|||
DISABLE_EMAIL_VERIFICATION = false
|
||||
DISABLE_BASIC_AUTHENTICATION = false
|
||||
DISABLE_MAGIC_LINK_LOGIN = false
|
||||
DISABLE_LOGIN_PAGE = false
|
||||
|
||||
// ROLES
|
||||
ROLES = []string{}
|
||||
|
|
1
server/env/env.go
vendored
1
server/env/env.go
vendored
|
@ -172,6 +172,7 @@ func InitEnv() {
|
|||
constants.DISABLE_BASIC_AUTHENTICATION = os.Getenv("DISABLE_BASIC_AUTHENTICATION") == "true"
|
||||
constants.DISABLE_EMAIL_VERIFICATION = os.Getenv("DISABLE_EMAIL_VERIFICATION") == "true"
|
||||
constants.DISABLE_MAGIC_LINK_LOGIN = os.Getenv("DISABLE_MAGIC_LINK_LOGIN") == "true"
|
||||
constants.DISABLE_LOGIN_PAGE = os.Getenv("DISABLE_LOGIN_PAGE") == "true"
|
||||
|
||||
if constants.SMTP_HOST == "" || constants.SENDER_EMAIL == "" || constants.SENDER_PASSWORD == "" {
|
||||
constants.DISABLE_EMAIL_VERIFICATION = true
|
||||
|
|
|
@ -32,14 +32,17 @@ func main() {
|
|||
|
||||
router := router.InitRouter()
|
||||
|
||||
// login wall app related routes.
|
||||
// login page app related routes.
|
||||
// if we put them in router file then tests would fail as templates or build path will be different
|
||||
router.LoadHTMLGlob("templates/*")
|
||||
app := router.Group("/app")
|
||||
{
|
||||
app.Static("/build", "app/build")
|
||||
app.GET("/", handlers.AppHandler())
|
||||
app.GET("/reset-password", handlers.AppHandler())
|
||||
if !constants.DISABLE_LOGIN_PAGE {
|
||||
router.LoadHTMLGlob("templates/*")
|
||||
app := router.Group("/app")
|
||||
{
|
||||
app.Static("/build", "app/build")
|
||||
app.GET("/", handlers.AppHandler())
|
||||
app.GET("/reset-password", handlers.AppHandler())
|
||||
}
|
||||
}
|
||||
|
||||
router.Run(":" + constants.PORT)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user