admin: Fix old routes

This commit is contained in:
nemunaire 2022-05-31 14:54:19 +02:00
parent 6c31820178
commit 70891bf0e9
1 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
c.JSON(http.StatusOK, gin.H{"password": passwd})
})
router.GET("/api/dex.yaml", func(c *gin.Context) {
router.GET("/dex.yaml", func(c *gin.Context) {
cfg, err := genDexConfig()
if err != nil {
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
@ -36,7 +36,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
c.String(http.StatusOK, string(cfg))
})
router.POST("/api/dex.yaml", func(c *gin.Context) {
router.POST("/dex.yaml", func(c *gin.Context) {
if dexcfg, err := genDexConfig(); err != nil {
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
return
@ -47,7 +47,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
c.JSON(http.StatusOK, true)
})
router.GET("/api/dex-password.tpl", func(c *gin.Context) {
router.GET("/dex-password.tpl", func(c *gin.Context) {
passtpl, err := genDexPasswordTpl()
if err != nil {
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
@ -56,7 +56,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
c.String(http.StatusOK, string(passtpl))
})
router.POST("/api/dex-password.tpl", func(c *gin.Context) {
router.POST("/dex-password.tpl", func(c *gin.Context) {
if dexcfg, err := genDexPasswordTpl(); err != nil {
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
return