2021-12-29 06:26:19 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/authorizerdev/authorizer/server/constants"
|
2022-01-17 06:02:13 +00:00
|
|
|
"github.com/authorizerdev/authorizer/server/envstore"
|
2021-12-29 06:26:19 +00:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
2022-01-17 06:02:13 +00:00
|
|
|
// DashboardHandler is the handler for the /dashboard route
|
2021-12-29 06:26:19 +00:00
|
|
|
func DashboardHandler() gin.HandlerFunc {
|
|
|
|
return func(c *gin.Context) {
|
2021-12-30 04:31:51 +00:00
|
|
|
isOnboardingCompleted := false
|
2021-12-31 11:54:22 +00:00
|
|
|
|
2022-02-28 02:25:01 +00:00
|
|
|
if envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyAdminSecret) != "" {
|
2021-12-30 04:31:51 +00:00
|
|
|
isOnboardingCompleted = true
|
2021-12-29 06:26:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
c.HTML(http.StatusOK, "dashboard.tmpl", gin.H{
|
2021-12-30 04:31:51 +00:00
|
|
|
"data": map[string]interface{}{
|
|
|
|
"isOnboardingCompleted": isOnboardingCompleted,
|
2021-12-29 06:26:19 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|