Skip to content

Commit

Permalink
docs: update oauth.md
Browse files Browse the repository at this point in the history
this is related to the issue redwoodjs#11694
  • Loading branch information
ejsinfuego authored Oct 17, 2024
1 parent 74e785d commit 915e911
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/docs/how-to/oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ 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' //on dbAuth v7.6.2, cookie setting has changed, you can check /api/src/functions/auth.ts

const callback = async (event) => {
const { code } = event.queryStringParameters
Expand Down Expand Up @@ -643,7 +644,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}=${encrypted}`, ...cookieAttrs].join('; ')
return [`session=${encrypted}`, ...cookieAttrs].join('; ')
}
// highlight-end
Expand Down

0 comments on commit 915e911

Please sign in to comment.