Skip to content

Commit df192be

Browse files
committed
feat: allow disabling login page
Resolves #89
1 parent 8d2371c commit df192be

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

server/constants/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var (
2626
DISABLE_EMAIL_VERIFICATION = false
2727
DISABLE_BASIC_AUTHENTICATION = false
2828
DISABLE_MAGIC_LINK_LOGIN = false
29+
DISABLE_LOGIN_PAGE = false
2930

3031
// ROLES
3132
ROLES = []string{}

server/env/env.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ func InitEnv() {
172172
constants.DISABLE_BASIC_AUTHENTICATION = os.Getenv("DISABLE_BASIC_AUTHENTICATION") == "true"
173173
constants.DISABLE_EMAIL_VERIFICATION = os.Getenv("DISABLE_EMAIL_VERIFICATION") == "true"
174174
constants.DISABLE_MAGIC_LINK_LOGIN = os.Getenv("DISABLE_MAGIC_LINK_LOGIN") == "true"
175+
constants.DISABLE_LOGIN_PAGE = os.Getenv("DISABLE_LOGIN_PAGE") == "true"
175176

176177
if constants.SMTP_HOST == "" || constants.SENDER_EMAIL == "" || constants.SENDER_PASSWORD == "" {
177178
constants.DISABLE_EMAIL_VERIFICATION = true

server/main.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ func main() {
3232

3333
router := router.InitRouter()
3434

35-
// login wall app related routes.
35+
// login page app related routes.
3636
// if we put them in router file then tests would fail as templates or build path will be different
37-
router.LoadHTMLGlob("templates/*")
38-
app := router.Group("/app")
39-
{
40-
app.Static("/build", "app/build")
41-
app.GET("/", handlers.AppHandler())
42-
app.GET("/reset-password", handlers.AppHandler())
37+
if !constants.DISABLE_LOGIN_PAGE {
38+
router.LoadHTMLGlob("templates/*")
39+
app := router.Group("/app")
40+
{
41+
app.Static("/build", "app/build")
42+
app.GET("/", handlers.AppHandler())
43+
app.GET("/reset-password", handlers.AppHandler())
44+
}
4345
}
46+
4447
router.Run(":" + constants.PORT)
4548
}

0 commit comments

Comments
 (0)