Merge remote-tracking branch 'origin' into chuck/web-2435-move-comments-and-webhooks-without-attachments
This commit is contained in:
@@ -363,8 +363,6 @@ export const workspaceTrackingFactory =
|
||||
case 'workspace.authorized':
|
||||
break
|
||||
case 'workspace.created':
|
||||
payload.createdByUserId
|
||||
|
||||
// we're setting workspace props and attributing to speckle users
|
||||
mixpanel.groups.set('workspace_id', payload.workspace.id, {
|
||||
...(await calculateProperties(payload.workspace)),
|
||||
|
||||
@@ -206,6 +206,7 @@ import { sendWorkspaceJoinRequestReceivedEmailFactory } from '@/modules/workspac
|
||||
import { getProjectFactory } from '@/modules/core/repositories/projects'
|
||||
import { OperationTypeNode } from 'graphql'
|
||||
import { updateWorkspacePlanFactory } from '@/modules/gatekeeper/services/workspacePlans'
|
||||
import { UserInputError } from '@/modules/core/errors/userinput'
|
||||
|
||||
const eventBus = getEventBus()
|
||||
const getServerInfo = getServerInfoFactory({ db })
|
||||
@@ -294,7 +295,8 @@ const updateStreamRoleAndNotify = updateStreamRoleAndNotifyFactory({
|
||||
const getUserStreams = getUserStreamsPageFactory({ db })
|
||||
const getUserStreamsCount = getUserStreamsCountFactory({ db })
|
||||
|
||||
const { FF_WORKSPACES_MODULE_ENABLED } = getFeatureFlags()
|
||||
const { FF_WORKSPACES_MODULE_ENABLED, FF_WORKSPACES_NEW_PLANS_ENABLED } =
|
||||
getFeatureFlags()
|
||||
|
||||
export = FF_WORKSPACES_MODULE_ENABLED
|
||||
? ({
|
||||
@@ -496,6 +498,12 @@ export = FF_WORKSPACES_MODULE_ENABLED
|
||||
default:
|
||||
throwUncoveredError(workspacePlan)
|
||||
}
|
||||
case 'free':
|
||||
if (FF_WORKSPACES_NEW_PLANS_ENABLED) {
|
||||
break
|
||||
} else {
|
||||
throw new UserInputError('Workspace plan not implemented')
|
||||
}
|
||||
case 'unlimited':
|
||||
case 'academia':
|
||||
case 'starterInvoiced':
|
||||
|
||||
@@ -358,6 +358,7 @@ export const getSsoRouter = (): Router => {
|
||||
return router
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const workspaceSsoAuthRequestParams = z.object({
|
||||
workspaceSlug: z.string().min(1)
|
||||
})
|
||||
@@ -686,10 +687,20 @@ const tryGetSpeckleUserDataFactory =
|
||||
|
||||
// Get user with email that matches OIDC provider user email, if match exists
|
||||
const providerEmail = getEmailFromOidcProfile(oidcProviderUserData)
|
||||
const userEmail = await findEmail({ email: providerEmail })
|
||||
const userEmail = await findEmail({ email: providerEmail.toLowerCase() })
|
||||
if (!!userEmail && !userEmail.verified) throw new SsoUserEmailUnverifiedError()
|
||||
const existingSpeckleUser = await getUser(userEmail?.userId ?? '')
|
||||
|
||||
// Log details about users we're comparing
|
||||
req.log.info(
|
||||
{
|
||||
providerEmail,
|
||||
currentSessionUserId: currentSessionUser?.id,
|
||||
existingSpeckleUserId: existingSpeckleUser?.id
|
||||
},
|
||||
'Computing active user information given current auth context:'
|
||||
)
|
||||
|
||||
// Confirm existing user matches signed-in user, if both are present
|
||||
if (!!currentSessionUser && !!existingSpeckleUser) {
|
||||
if (currentSessionUser.id !== existingSpeckleUser.id) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { expect } from 'chai'
|
||||
import { assign } from 'lodash'
|
||||
|
||||
const createTestWorkspaceWithDomains = (
|
||||
arg?: Partial<WorkspaceWithDomains> | undefined
|
||||
arg?: Partial<WorkspaceWithDomains>
|
||||
): WorkspaceWithDomains => {
|
||||
const workspace: WorkspaceWithDomains = {
|
||||
createdAt: new Date(),
|
||||
|
||||
@@ -116,7 +116,7 @@ describe('Workspace services', () => {
|
||||
const err = await expectToThrow(() => {
|
||||
validateWorkspaceSlug(cryptoRandomString({ length: 31 }))
|
||||
})
|
||||
expect(err.message).to.contain('slug must not exceed')
|
||||
expect(err.message).to.contain('must not exceed')
|
||||
})
|
||||
it('throws for invalid start', async () => {
|
||||
const err = await expectToThrow(() => {
|
||||
|
||||
Reference in New Issue
Block a user