authorizer/server/utils/cookie.go
Lakhan Samani 27264c6e29
Implement login resolver (#15)
* add sign_up_method to users table

* add session store

* implement login resolver
2021-07-15 00:13:19 +05:30

18 lines
324 B
Go

package utils
import (
"github.com/gin-gonic/gin"
"github.com/yauthdev/yauth/server/constants"
)
func SetCookie(gc *gin.Context, token string) {
secure := true
httpOnly := true
if !constants.IS_PROD {
secure = false
}
gc.SetCookie(constants.COOKIE_NAME, token, 3600, "/", GetFrontendHost(), secure, httpOnly)
}