Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update oauth.md #11698

Merged
merged 11 commits into from
Nov 17, 2024
5 changes: 4 additions & 1 deletion docs/docs/how-to/oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading