authorizer/server/handlers/dashboard.go

27 lines
635 B
Go
Raw Permalink Normal View History

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"
"github.com/gin-gonic/gin"
)
2022-01-17 06:02:13 +00:00
// DashboardHandler is the handler for the /dashboard route
func DashboardHandler() gin.HandlerFunc {
return func(c *gin.Context) {
2021-12-30 04:31:51 +00:00
isOnboardingCompleted := false
if envstore.EnvInMemoryStoreObj.GetStringStoreEnvVariable(constants.EnvKeyAdminSecret) != "" {
2021-12-30 04:31:51 +00:00
isOnboardingCompleted = true
}
c.HTML(http.StatusOK, "dashboard.tmpl", gin.H{
2021-12-30 04:31:51 +00:00
"data": map[string]interface{}{
"isOnboardingCompleted": isOnboardingCompleted,
},
})
}
}