mirror of
https://github.com/BradNut/node-auth
synced 2025-09-08 17:40:17 +00:00
Adding domain to env and referencing when creating cookies.
This commit is contained in:
parent
24c7442dfd
commit
e4adacf7c1
1 changed files with 3 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ import { createTokens } from './tokens.js'
|
|||
const { ObjectId } = mongo
|
||||
|
||||
const JWTSignature = process.env.JWT_SIGNATURE
|
||||
const { ROOT_DOMAIN } = process.env
|
||||
|
||||
export async function getUserFromCookies(request, reply) {
|
||||
try {
|
||||
|
|
@ -58,13 +59,13 @@ export async function refreshTokens(sessionToken, userId, reply) {
|
|||
reply
|
||||
.setCookie('refreshToken', refreshToken, {
|
||||
path: "/",
|
||||
domain: "localhost",
|
||||
domain: ROOT_DOMAIN,
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
expires: refreshExpires,
|
||||
}).setCookie('accessToken', accessToken, {
|
||||
path: "/",
|
||||
domain: "localhost",
|
||||
domain: ROOT_DOMAIN,
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue