Include the upstream when signing terms

This commit is contained in:
Travis Ralston 2019-08-03 12:40:52 -06:00
parent 3831f2f7bc
commit e8551659fd

View File

@ -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);