From e8551659fd025fa3d24014de8535bf91ebf8010f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 3 Aug 2019 12:40:52 -0600 Subject: [PATCH] Include the upstream when signing terms --- src/db/ScalarStore.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/db/ScalarStore.ts b/src/db/ScalarStore.ts index c610154..60377a3 100644 --- a/src/db/ScalarStore.ts +++ b/src/db/ScalarStore.ts @@ -67,6 +67,7 @@ export class ScalarStore { // First see if we have a token for the upstream so we can try it const existingTokens = await UserScalarToken.findAll({ where: {isDimensionToken: false, userId: testUserId, upstreamId: upstream.id}, + include: [Upstream], }); if (existingTokens && existingTokens.length) { // Test that the token works @@ -120,6 +121,7 @@ export class ScalarStore { isDimensionToken: false, upstreamId: upstream.id, }); + scalarToken.upstream = upstream; // Accept all terms of service for the user await ScalarStore.signAllTerms(scalarToken, scalarKind);