-
Notifications
You must be signed in to change notification settings - Fork 131
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 401 token request in WordPressTemplate #1724
Conversation
🦋 Changeset detectedLatest commit: 44dcba4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 Next.js Bundle Analysis for @faustwp/getting-started-exampleThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
246.1 KB (🟡 +55 B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, only seeing the 401 when experimentalToolbar: true, as expected. 💯
I added some testing suggestions to cover the new skip option in useAuth
Co-authored-by: Joe Fusco <josephfusco@users.noreply.github.com>
Tasks
Description
This PR skips the
useAuth
call unless the route is a preview route. Currently,useAuth
is running on every page, which in turn makes a request to the token endpoint to see if a user is authenticated.Related Issue(s):
Testing
npm install
from the rootnpm run build
from the rootnpm run dev -w @faustwp/getting-started-example
from the rootexperimentalToolbar
is enabled)useAuth
hook operates as normal/expected with and without the newskip
option.Screenshots
Documentation Changes
Closes #1722