Summary
When using the edgespark-quick skill's two-phase deploy pattern (Phase 1: deploy with signup open → seed admin via platform endpoint → Phase 2: edgespark auth apply to disable signup → redeploy), client.auth.signIn.email() returns an error for the first few minutes after Phase 2 completes, even though the credentials are valid.
This is specific to the edgespark-quick skill's admin seeding workflow: since EdgeSpark has no server-side auth.api.signUpEmail, the skill must temporarily open public signup, POST to /api/_es/auth/sign-up/email to create the admin user, then lock signup via disableSignUp: true and redeploy. The config change from edgespark auth apply appears to have a propagation delay to D1 edge nodes, during which sign-in behaves inconsistently.
Steps to Reproduce
edgespark init a new project with email/password auth enabled
- Phase 1:
edgespark deploy with disableSignUp: false (default)
- Seed an admin user via
curl -X POST https://<slug>.edgespark.app/api/_es/auth/sign-up/email — succeeds (HTTP 200)
- Edit
configs/auth-config.yaml → disableSignUp: true
edgespark auth apply — succeeds
- Phase 2:
edgespark deploy — succeeds
- Immediately attempt
client.auth.signIn.email({ email, password }) from the browser
Expected Behavior
Sign-in should succeed immediately after Phase 2 deploy completes, since the admin user was already created and the only config change was disabling public signup.
Actual Behavior
client.auth.signIn.email() returns { data: null, error: { ... } } — treated as "Invalid credentials" by the app. The same credentials work fine:
- Via direct
curl to /api/_es/auth/sign-in/email at the same time (returns 200 with token)
- After waiting ~2-3 minutes and trying again in the browser
- After a 3rd deploy (no meaningful code change, just added console.log)
Environment
edgespark CLI: v0.0.13
@edgespark/web: latest (as of 2026-04-14)
- Auth provider:
providerEmailPassword (no OAuth)
- Skill: edgespark-quick
- Browser: Chrome (macOS)
Analysis
The sign-in API endpoint itself works (confirmed via curl at the same time the browser fails). The issue appears to be a propagation delay between edgespark auth apply modifying the auth config in D1 and that config being fully consistent across edge nodes for the Better Auth client-side flow. During this window, signIn.email() via @edgespark/web encounters an intermediate state that causes it to return an error, while the raw REST endpoint still works.
The problem resolved itself after ~2-3 minutes (or after a subsequent deploy), suggesting eventual consistency in the auth config layer.
Why This Is Specific to edgespark-quick
Normal apps don't hit this because they either:
- Use the managed auth UI (no two-phase deploy needed), or
- Don't toggle
disableSignUp between deploys
The edgespark-quick skill specifically needs this pattern because it auto-seeds an admin account without requiring human registration — the only way to do this on EdgeSpark is to temporarily open signup, create the user via the platform endpoint, then lock it down. This open → seed → lock → redeploy cycle is what triggers the propagation delay.
Suggested Fix / Workaround
Current workaround in the skill: After Phase 2 deploy, wait 15-30 seconds before validating sign-in.
Platform fix suggestions:
- Ensure
edgespark deploy waits for auth config convergence before reporting success, or
- Make
edgespark auth apply + edgespark deploy atomic so the config and code ship together, or
- Provide a server-side admin seeding API (e.g.
auth.api.signUpEmail or a CLI command like edgespark auth seed-user) so the two-phase deploy pattern isn't needed at all, or
- Document the expected propagation delay after
auth apply in the CLI output
Summary
When using the edgespark-quick skill's two-phase deploy pattern (Phase 1: deploy with signup open → seed admin via platform endpoint → Phase 2:
edgespark auth applyto disable signup → redeploy),client.auth.signIn.email()returns an error for the first few minutes after Phase 2 completes, even though the credentials are valid.This is specific to the
edgespark-quickskill's admin seeding workflow: since EdgeSpark has no server-sideauth.api.signUpEmail, the skill must temporarily open public signup, POST to/api/_es/auth/sign-up/emailto create the admin user, then lock signup viadisableSignUp: trueand redeploy. The config change fromedgespark auth applyappears to have a propagation delay to D1 edge nodes, during which sign-in behaves inconsistently.Steps to Reproduce
edgespark inita new project with email/password auth enablededgespark deploywithdisableSignUp: false(default)curl -X POST https://<slug>.edgespark.app/api/_es/auth/sign-up/email— succeeds (HTTP 200)configs/auth-config.yaml→disableSignUp: trueedgespark auth apply— succeedsedgespark deploy— succeedsclient.auth.signIn.email({ email, password })from the browserExpected Behavior
Sign-in should succeed immediately after Phase 2 deploy completes, since the admin user was already created and the only config change was disabling public signup.
Actual Behavior
client.auth.signIn.email()returns{ data: null, error: { ... } }— treated as "Invalid credentials" by the app. The same credentials work fine:curlto/api/_es/auth/sign-in/emailat the same time (returns 200 with token)Environment
edgesparkCLI: v0.0.13@edgespark/web: latest (as of 2026-04-14)providerEmailPassword(no OAuth)Analysis
The sign-in API endpoint itself works (confirmed via
curlat the same time the browser fails). The issue appears to be a propagation delay betweenedgespark auth applymodifying the auth config in D1 and that config being fully consistent across edge nodes for the Better Auth client-side flow. During this window,signIn.email()via@edgespark/webencounters an intermediate state that causes it to return an error, while the raw REST endpoint still works.The problem resolved itself after ~2-3 minutes (or after a subsequent deploy), suggesting eventual consistency in the auth config layer.
Why This Is Specific to edgespark-quick
Normal apps don't hit this because they either:
disableSignUpbetween deploysThe
edgespark-quickskill specifically needs this pattern because it auto-seeds an admin account without requiring human registration — the only way to do this on EdgeSpark is to temporarily open signup, create the user via the platform endpoint, then lock it down. This open → seed → lock → redeploy cycle is what triggers the propagation delay.Suggested Fix / Workaround
Current workaround in the skill: After Phase 2 deploy, wait 15-30 seconds before validating sign-in.
Platform fix suggestions:
edgespark deploywaits for auth config convergence before reporting success, oredgespark auth apply+edgespark deployatomic so the config and code ship together, orauth.api.signUpEmailor a CLI command likeedgespark auth seed-user) so the two-phase deploy pattern isn't needed at all, orauth applyin the CLI output