Bind each customer to a Verae userId for hop tracing
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
Signup registers/binds a Verae central user and stores veraeUserId. Public access stays the zappier API key. Chain JWTs stay server-side behind tokenRef. Authz, billing, and jobs.watch carry veraeUserId.
This commit is contained in:
parent
1b199ca4d4
commit
345aeeead9
79 changed files with 703 additions and 95 deletions
|
|
@ -18,8 +18,14 @@ export const authenticate = asyncHandler(async (req, res, next) => {
|
|||
extractBearerToken(req.headers.authorization) ?? req.headers['x-api-key'] ?? null;
|
||||
|
||||
req.auth = await resolveAuthContext(rawToken);
|
||||
const headerId = req.headers['x-verae-user-id'];
|
||||
if (typeof headerId === 'string' && headerId.startsWith('vu_') && !req.auth.veraeUserId) {
|
||||
req.auth.veraeUserId = headerId;
|
||||
if (req.auth.tenant) req.auth.tenant.veraeUserId = headerId;
|
||||
}
|
||||
log.debug('authenticated', {
|
||||
tenantId: req.auth.tenantId,
|
||||
veraeUserId: req.auth.veraeUserId,
|
||||
method: req.auth.authMethod,
|
||||
plan: req.auth.tenant?.plan,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue