21 lines
242 B
Go
21 lines
242 B
Go
package utils
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func SetCookie(c *gin.Context, token string) {
|
|
c.SetSameSite(http.SameSiteLaxMode)
|
|
c.SetCookie(
|
|
"jwt",
|
|
token,
|
|
5*24*60*60, // 5 days
|
|
"/",
|
|
"",
|
|
true,
|
|
true,
|
|
)
|
|
}
|