admin: Fix old routes
This commit is contained in:
parent
6c31820178
commit
70891bf0e9
@ -27,7 +27,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
|
|||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{"password": passwd})
|
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()
|
cfg, err := genDexConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
||||||
@ -36,7 +36,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
|
|||||||
|
|
||||||
c.String(http.StatusOK, string(cfg))
|
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 {
|
if dexcfg, err := genDexConfig(); err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
||||||
return
|
return
|
||||||
@ -47,7 +47,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
|
|||||||
|
|
||||||
c.JSON(http.StatusOK, true)
|
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()
|
passtpl, err := genDexPasswordTpl()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
||||||
@ -56,7 +56,7 @@ func declarePasswordRoutes(router *gin.RouterGroup) {
|
|||||||
|
|
||||||
c.String(http.StatusOK, string(passtpl))
|
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 {
|
if dexcfg, err := genDexPasswordTpl(); err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": err.Error()})
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user