Merge remote-tracking branch 'origin/main'

This commit is contained in:
Nevo David 2024-10-23 14:51:09 +07:00
commit 05a24fe020
6 changed files with 26 additions and 24 deletions

View File

@ -38,7 +38,7 @@ export const SettingsPopup: FC<{ getRef?: Ref<any> }> = (props) => {
}, []);
const url = useSearchParams();
const showLogout = !url.get('onboarding');
const showLogout = !url.get('onboarding') || user?.tier?.current === "FREE";
const loadProfile = useCallback(async () => {
const personal = await (await fetch('/user/personal')).json();

View File

@ -1,7 +1,7 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { fetchBackend } from '@gitroom/helpers/utils/custom.fetch.func';
import { getCookieUrlFromDomain } from '@gitroom/helpers/subdomain/subdomain.management';
import { internalFetch } from '@gitroom/helpers/utils/internal.fetch';
// This function can be marked `async` if using `await` inside
export async function middleware(request: NextRequest) {
@ -68,13 +68,10 @@ export async function middleware(request: NextRequest) {
try {
if (org) {
const { id } = await (
await fetchBackend('/user/join-org', {
await internalFetch('/user/join-org', {
body: JSON.stringify({
org,
}),
headers: {
auth: authCookie?.value!,
},
method: 'POST',
})
).json();

View File

@ -1,4 +1,3 @@
import { loadVars } from '@gitroom/react/helpers/variable.context';
export interface Params {
baseUrl: string;
@ -48,6 +47,6 @@ export const customFetch = (
export const fetchBackend = customFetch({
get baseUrl() {
return loadVars().backendUrl;
return process.env.BACKEND_URL!;
},
});

View File

@ -46,7 +46,7 @@ export class OrganizationService {
}
async inviteTeamMember(orgId: string, body: AddTeamMemberDto) {
const timeLimit = dayjs().add(15, 'minutes').format('YYYY-MM-DD HH:mm:ss');
const timeLimit = dayjs().add(1, 'hour').format('YYYY-MM-DD HH:mm:ss');
const id = makeId(5);
const url =
process.env.FRONTEND_URL +
@ -55,7 +55,7 @@ export class OrganizationService {
await this._notificationsService.sendEmail(
body.email,
'You have been invited to join an organization',
`You have been invited to join an organization. Click <a href="${url}">here</a> to join.<br />The link will expire in 15 minutes.`
`You have been invited to join an organization. Click <a href="${url}">here</a> to join.<br />The link will expire in 1 hour.`
);
}
return { url };

View File

@ -25,6 +25,8 @@ export const getUppyUploadPlugin = (provider: string, fetch: any, backendUrl: st
return {
plugin: AwsS3Multipart,
options: {
shouldUseMultipart: (file : any) => true,
endpoint: '',
createMultipartUpload: async (file: any) => {
const arrayBuffer = await new Response(file.data).arrayBuffer();
const fileHash = sha256(Buffer.from(arrayBuffer));

32
package-lock.json generated
View File

@ -7772,13 +7772,14 @@
}
},
"node_modules/@nestjs/platform-express": {
"version": "10.4.4",
"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.4.4.tgz",
"integrity": "sha512-y52q1MxhbHaT3vAgWd08RgiYon0lJgtTa8U6g6gV0KI0IygwZhDQFJVxnrRDUdxQGIP5CKHmfQu3sk9gTNFoEA==",
"version": "10.4.5",
"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.4.5.tgz",
"integrity": "sha512-a629r8R8KC4skhdieQ0aIWH5vDBUFntWnWKFyDXQrll6/CllSchfWm87mWF39seaW6bXYtQtAEZY66JrngdrGA==",
"license": "MIT",
"dependencies": {
"body-parser": "1.20.3",
"cors": "2.8.5",
"express": "4.21.0",
"express": "4.21.1",
"multer": "1.4.4-lts.1",
"tslib": "2.7.0"
},
@ -19759,16 +19760,17 @@
"integrity": "sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg=="
},
"node_modules/express": {
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
"integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==",
"version": "4.21.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
"integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
"license": "MIT",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.3",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.6.0",
"cookie": "0.7.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
@ -19800,9 +19802,10 @@
}
},
"node_modules/express/node_modules/cookie": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz",
"integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==",
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
@ -31757,9 +31760,10 @@
}
},
"node_modules/polotno": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/polotno/-/polotno-2.14.1.tgz",
"integrity": "sha512-lJEaROyHogUx3e+YZa18Q24pFNGiQ3VQebw94mcmgwBg6S8KPptMGCaXsq/JTpY6Wrisaxu0wSAXAYhwYV8F1Q==",
"version": "2.14.3",
"resolved": "https://registry.npmjs.org/polotno/-/polotno-2.14.3.tgz",
"integrity": "sha512-CYf5BmK12wAYpnFnHpe8gSoYksPr5RmJQXHAib00Fx09FSG47jLzVC+R/v7CpDrcOW/1CpQqONz1po0D245xjA==",
"license": "SEE LICENSE IN LICENSE.md",
"dependencies": {
"@blueprintjs/core": "5.12.0",
"@blueprintjs/select": "5.2.3",