documentation finished

This commit is contained in:
Florian Hoss 2022-04-08 16:55:59 +02:00
parent 40abac78bd
commit ae335a1511
10 changed files with 105 additions and 48 deletions

View file

@ -99,6 +99,12 @@ func (wp *Webpage) defineRoutes() {
}
c.JSON(200, gin.H{"logged_in": false, "username": ""})
})
auth.PUT("/user", func(c *gin.Context) {
username := c.Query("username")
password := c.Query("password")
wp.Database.ChangeUserPassword(username, password)
c.JSON(200, gin.H{"message": "success"})
})
auth.POST("/logout", func(c *gin.Context) {
username, uExisting := c.GetPostForm("username")
if uExisting == false || username == "" {