Add the client half of the auth provider contract with generated wiring - #4732
Draft
FranjoMindek wants to merge 1 commit into
Draft
Add the client half of the auth provider contract with generated wiring#4732FranjoMindek wants to merge 1 commit into
FranjoMindek wants to merge 1 commit into
Conversation
15 tasks
Deploying wasp-docs-on-main with
|
| Latest commit: |
ad3d5c4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://989639a8.wasp-docs-on-main.pages.dev |
| Branch Preview URL: | https://franjo-auth2-client-adapter.wasp-docs-on-main.pages.dev |
FranjoMindek
had a problem deploying
to
railway-deploy-test
August 15, 2026 16:43 — with
GitHub Actions
Failure
FranjoMindek
temporarily deployed
to
fly-deploy-test
August 15, 2026 16:43 — with
GitHub Actions
Inactive
@wasp.sh/spec
@wasp.sh/wasp-cli
@wasp.sh/wasp-cli-darwin-arm64-unknown
@wasp.sh/wasp-cli-darwin-x64-unknown
@wasp.sh/wasp-cli-linux-arm64-glibc
@wasp.sh/wasp-cli-linux-x64-glibc
@wasp.sh/wasp-cli-linux-x64-musl
commit: |
FranjoMindek
force-pushed
the
franjo/auth2-client-adapter
branch
from
August 16, 2026 21:26
ad9ed6a to
e5ee09e
Compare
FranjoMindek
had a problem deploying
to
railway-deploy-test
August 16, 2026 21:33 — with
GitHub Actions
Failure
FranjoMindek
temporarily deployed
to
fly-deploy-test
August 16, 2026 21:33 — with
GitHub Actions
Inactive
FranjoMindek
force-pushed
the
franjo/auth2-client-adapter
branch
from
August 17, 2026 08:43
e5ee09e to
804a07f
Compare
FranjoMindek
temporarily deployed
to
fly-deploy-test
August 17, 2026 09:16 — with
GitHub Actions
Inactive
FranjoMindek
had a problem deploying
to
railway-deploy-test
August 17, 2026 09:16 — with
GitHub Actions
Failure
FranjoMindek
force-pushed
the
franjo/auth2-client-adapter
branch
from
August 18, 2026 16:54
804a07f to
ad3d5c4
Compare
FranjoMindek
temporarily deployed
to
fly-deploy-test
August 18, 2026 17:59 — with
GitHub Actions
Inactive
FranjoMindek
had a problem deploying
to
railway-deploy-test
August 18, 2026 17:59 — with
GitHub Actions
Failure
Contributor
|
This pull request is now stale. Next steps if the PR is still relevant, and you are able to devote time to it:
If no action is taken, this PR will be automatically closed in 7 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stack 7/8 (between adapter codegen and the packages). The client half of the auth provider contract, landing together with its generated consumers.
The problem it solves: client integration was the design's weakest part — hand-written
App.tsxglue per app, a push-based token bridge with a staleness window across Clerk's ~60s rotations, andlogout()that didn't tell the provider's client.@wasp.sh/auth-contract/client):ClientAuthAdapter { Wrapper?, getCredential(), onCredentialChange?, onLogout? }+WaspClientRuntime+ClientAdapterFactory.getCredentialis pull-based on purpose (asked at each request, rotating tokens always current) and doubles as the readiness gate (resolves only once the provider's client is loaded).client: { package }entry, mapped to IRclientPackage— consumed this time, unlike its earlier deleted incarnation.wasp/client/auth/providermodule instantiatescreateClientAdapter(runtime, options)with the manifest-validated client env;WaspAppcomposesWrapperaround the app (outsiderootComponent); the api client'sbeforeRequestawaitsgetCredential()instead of reading stored state;logout()callsonLogout(); credential changes rebroadcast into the existingsessionIdevents so query invalidation and websockets react for free.No package implements it in this PR (the shape is final; consumers of the factory arrive one PR later, same pattern as the server half in the previous PR).
Review guidance: the contract file and the generated
provider.tstemplate are the substance; the api/logout/WaspApp edits are small conditional branches, inert for every app without a client adapter (kitchen-sink goldens prove it).Type of change
Checklist
I tested my change in a Wasp app to verify that it works as intended.
🧪 Tests and apps:
examples/kitchen-sink/e2e-tests.waspc/data/Cli/templates, as needed.examples/, as needed.examples/tutorials) I updated the tutorial in the docs (and vice versa).📜 Documentation:
web/docs/.🆕 Changelog: (if change is more than just code/docs improvement)
waspc/ChangeLog.mdwith a user-friendly description of the change.web/docs/migration-guides/.versioninwaspc/waspc.cabalto reflect the changes I introduced.