-
Notifications
You must be signed in to change notification settings - Fork 133
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
Only request token endpoint initially, then use a cookie to determine if there is an authenticated user #1740
Conversation
🦋 Changeset detectedLatest commit: b445a6b 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 |
247.03 KB (🟡 +559 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!
Closes #1723 |
Co-authored-by: Matthew Wright <1815200+matthewguywright@users.noreply.github.com>
Closes #1794 |
Tasks
Description
This PR addresses #1723 (comment) and creates a new cookie that determines if there is a refresh token saved in the cookie, without exposing sensitive data and is accessible in the browser/client.
This allows us to make one initial request to the token endpoint, and then thereafter reference the cookie to determine if there is an authenticated user for stuff like the toolbar. This essentially turns a request for the token on every single page to only once for non-authenticated users.
Related Issue(s):
Testing
canary
branch, start the example project:npm run dev -w @faustwp/getting-started-example
npm install
at the monorepo rootnpm run build
at the monorepo rootnpm run dev -w @faustwp/getting-started-example
Other testing things to ensure functionality still works as expected
Screenshots
Documentation Changes
Dependant PRs