mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Gate server and admin emulator requests on credential init
Some checks failed
DB migration compat / Check if migrations changed (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled
Some checks failed
DB migration compat / Check if migrations changed (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled
Add prepareRequest callbacks to StackServerInterface and StackAdminInterface that await _emulatorInitPromise, matching the existing pattern in the client app. Prevents race conditions where requests use placeholder credentials before the emulator credentials are fetched.
This commit is contained in:
parent
01ca85027c
commit
25f8b1ca48
@ -148,6 +148,9 @@ export class _StackAdminAppImplIncomplete<HasTokenStore extends boolean, Project
|
||||
secretServerKey: resolvedOptions.secretServerKey ?? getDefaultSecretServerKey({ isEmulator }),
|
||||
superSecretAdminKey: resolvedOptions.superSecretAdminKey ?? getDefaultSuperSecretAdminKey({ isEmulator }),
|
||||
},
|
||||
prepareRequest: async () => {
|
||||
if (this._emulatorInitPromise) await this._emulatorInitPromise;
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
@ -424,6 +424,9 @@ export class _StackServerAppImplIncomplete<HasTokenStore extends boolean, Projec
|
||||
clientVersion,
|
||||
...(publishableClientKey != null ? { publishableClientKey } : {}),
|
||||
secretServerKey: resolvedOptions.secretServerKey ?? getDefaultSecretServerKey({ isEmulator }),
|
||||
prepareRequest: async () => {
|
||||
if (this._emulatorInitPromise) await this._emulatorInitPromise;
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user