some stuff

This commit is contained in:
2022-02-08 17:48:17 +01:00
parent 90663f3bfe
commit cb992c955a
20 changed files with 1525 additions and 1339 deletions

View File

@@ -25,7 +25,7 @@ func Register(c *gin.Context) {
return
}
c.SetCookie("token", token, 2*60*60, "", "", false, true)
c.Status(http.StatusCreated)
c.JSON(http.StatusCreated, gin.H{"username": user.Username, "email": user.Email})
}
func Login(c *gin.Context) {
@@ -48,7 +48,7 @@ func Login(c *gin.Context) {
token, _ := auth.GenerateJWT(user.ID, user.Username, user.Email)
c.SetCookie("token", token, 2*60*60, "", "", false, true)
c.Status(http.StatusOK)
c.JSON(http.StatusOK, gin.H{"username": user.Username, "email": user.Email})
}
func Logout(c *gin.Context) {