Use httpOnly Cookie
This commit is contained in:
parent
fb97208785
commit
b5c81aa956
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user