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

Fix SSR #578

Merged
merged 1 commit into from
Sep 17, 2020
Merged

Fix SSR #578

merged 1 commit into from
Sep 17, 2020

Conversation

adamjmcgrath
Copy link
Contributor

Description

We've introduced a regression where calling new Auth0Client({ ... }) will fail in an SSR environment because it relies on sessionStorage stevehobbsdev@937025c#diff-7edf092a689fc6f24b10820757119ce4L24 (see where the check for window undefined has been removed)

Unfortunately our ssr tests which are designed to catch this, didn't pick this up because we stub sessionStorage in all environments. I've only noticed it because the auth0-react tests don't stub it https://app.circleci.com/pipelines/github/auth0/auth0-react/251/workflows/0cc79dde-40bd-4b7e-852d-eee41fbd50dc/jobs/263

Our 'check all the frameworks' tests didn't catch it because we only check importing the class, not instantiating it https://gist.github.com/adamjmcgrath/ff26be1795aeb1689e657c7fbc885021#file-run-sh-L6

I'll need to release a patch for this before I publish auth0-react

@adamjmcgrath adamjmcgrath added small CH: Fixed PR is fixing a bug labels Sep 17, 2020
@adamjmcgrath adamjmcgrath requested a review from a team September 17, 2020 13:44
Copy link
Contributor

@stevehobbsdev stevehobbsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, I think this will help us support SSR in Angular, too 👍

@adamjmcgrath adamjmcgrath merged commit 5a4c0c8 into master Sep 17, 2020
@adamjmcgrath adamjmcgrath deleted the fix-ssr branch September 17, 2020 14:01
@adamjmcgrath adamjmcgrath modified the milestones: v1.10.0, v1.12.1 Sep 17, 2020
leemhenson pushed a commit to smolltd/auth0-spa-js that referenced this pull request Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants