diff --git a/controllers/usersController.go b/controllers/usersController.go index 0a734d8..02f6a06 100644 --- a/controllers/usersController.go +++ b/controllers/usersController.go @@ -107,6 +107,17 @@ func LogIn(c *gin.Context) { }) } +func LogOut (c *gin.Context){ + // Hapus informasi autentikasi atau sesi dari pengguna (misalnya token, cookie, atau data sesi) + // Contoh: Hapus cookie autentikasi + c.SetCookie("Authorization", "", -1, "/", "", false, true) + + // Berikan respons berhasil logout + c.JSON(http.StatusOK, gin.H{ + "message": "Logout successful", + }) +} + func Validate(c *gin.Context) { user, _ := c.Get("user") diff --git a/go-crud.exe b/go-crud.exe index d5af0c2..a2221a1 100644 Binary files a/go-crud.exe and b/go-crud.exe differ