diff --git a/docs/docs/how-to/oauth.md b/docs/docs/how-to/oauth.md index 1c52a9c8968e..da9ad9f65ee9 100644 --- a/docs/docs/how-to/oauth.md +++ b/docs/docs/how-to/oauth.md @@ -578,6 +578,8 @@ Don't forget the new `CryptoJS` import at the top! ```js title="/api/src/functions/oauth/oauth.js" // highlight-next-line import CryptoJS from 'crypto-js' +import { cookieName } from '@redwoodjs/auth-dbauth-api' +import { cookieName as cookie } from 'src/lib/auth' const callback = async (event) => { const { code } = event.queryStringParameters @@ -643,7 +645,8 @@ const secureCookie = (user) => { data, process.env.SESSION_SECRET ).toString() - + //if you're using dbAuth v7.6.2, you have to change the cookie name. You can comment out the line below and make the next line as comment. + //return [`${cookieName(cookie)}=${encrypted}`, ...cookieAttrs].join('; ') return [`session=${encrypted}`, ...cookieAttrs].join('; ') } // highlight-end