Nextjs-auth0: logout doesn't clear cookies on AWS Lamda Edge

Created on 5 Nov 2019  路  7Comments  路  Source: auth0/nextjs-auth0

Description

I have copied the Next.js Auth0 example and deployed it using this
Next.js Serverless Component.
After deploying to Cloudfront Edge, everything works but logout. The profile page maintains logged in state. I have tried everything I can think of before opening a ticket here...this is now blocking company upgrade to Next.js with Auth0. Please help!

Reproduction

  • fork reproduction repository
  • npm install
  • Add AWS key/secret to .env file following .env.template
  • Add auth0 client/domain/secrets to .env-cmdrc file
  • verify logout works locally npm run dev
  • deploy to aws using npm run deployStaging
  • put the generated Cloudfront domain into .env-cmdrc REDIRECT_URI and POST_LOGOUT_REDIRECT_URI
  • re-deploy to aws using npm run deployStaging so deployed version has correct redirect URI
  • put generated cloudfront domain into Auth0 settings (Allowed Callback URLs, etc)
  • attempt logout.
    Expected result - cookies are cleared
    Actual result - cookies remain and user is not logged out

Environment

  • Version of this library used: 0.5.0
  • Version of the platform or framework used, if applicable: single page application
  • Other relevant versions (language, server software, OS, browser):
  • Other modules/plugins/libraries that might be involved:

You can see a demo here: https://d2bmt8y5gix34p.cloudfront.net

bug

Most helpful comment

@nodabladam I can see the issue on the serverless-next.js component repo was closed (https://github.com/danielcondemarin/serverless-next.js/issues/246), have you found a work around? I'm encountering the same problem.

All 7 comments

Same problem here. Did you find a workaround @nodabladam ?

@marcoschicote Not yet, no. I found some issues in serverless-next.js caching and reported them and I believe they are fixed in latest version. I will try and retest. You using serverless-next.js and trying the latest 1.6 version?

@nodabladam yes. NextJS 9.0.3 and serverless-next.js 1.6.0.

@marcoschicote I just retested and don't believe the caching issues were fixed yet in 1.6.0 :(
I am not sure the cache settings on default cdn route have anything to do with this though.

@nodabladam I can see the issue on the serverless-next.js component repo was closed (https://github.com/danielcondemarin/serverless-next.js/issues/246), have you found a work around? I'm encountering the same problem.

Running in the same issues... Is there a solution?
"@auth0/nextjs-auth0": "^0.10.0"
"next": "^9.1.4"
"serverless-next.js": "^1.8.0"

Hi, can you please check if this issue still happens in the v1.0.0-beta.0 release? We've completely reworked the session logic.

If so, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RyGuyM picture RyGuyM  路  5Comments

platocrat picture platocrat  路  3Comments

jkjustjoshing picture jkjustjoshing  路  4Comments

mustafaKamal-fe picture mustafaKamal-fe  路  5Comments

lunchboxav picture lunchboxav  路  5Comments