Use httpOnly Cookie
This commit is contained in:
		
							
								
								
									
										2
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.go
									
									
									
									
									
								
							| @@ -79,7 +79,7 @@ func loginPost(c *gin.Context) { | |||||||
| 			c.AbortWithStatus(http.StatusUnauthorized) | 			c.AbortWithStatus(http.StatusUnauthorized) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		c.SetCookie("authentication", t, (int)((expiration * time.Hour).Seconds()), "/", "localhost:8080", true, false) | 		c.SetCookie("authentication", t, (int)((expiration * time.Hour).Seconds()), "/", "localhost:8080", true, true) | ||||||
|  |  | ||||||
| 		c.JSON(http.StatusOK, map[string]string{ | 		c.JSON(http.StatusOK, map[string]string{ | ||||||
| 			"token": t, | 			"token": t, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user