mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-29 22:39:27 +00:00
* WIP * wip * Update keto.yml, socket_routes.go, and 12 more files... * fixes and docs * Update api.js * Update auth.go and api.js * Update user_role_provider.go * Update config_routes.go and api.js * Update consts.go
24 lines
699 B
Go
24 lines
699 B
Go
package controllers
|
|
|
|
import (
|
|
"mizuserver/pkg/providers"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/up9inc/mizu/shared/logger"
|
|
)
|
|
|
|
func IsSetupNecessary(c *gin.Context) {
|
|
if IsInstallNeeded, err := providers.IsInstallNeeded(); err != nil {
|
|
logger.Log.Errorf("unknown internal while checking if install is needed %s", err)
|
|
c.AbortWithStatusJSON(500, gin.H{"error": "internal error occured while checking if install is needed"})
|
|
} else {
|
|
c.JSON(http.StatusOK, IsInstallNeeded)
|
|
}
|
|
}
|
|
|
|
func SetupAdminUser(c *gin.Context) {
|
|
token, err, formErrorMessages := providers.CreateAdminUser(c.PostForm("password"), c.Request.Context())
|
|
handleRegistration(token, err, formErrorMessages, c)
|
|
}
|