File tree Expand file tree Collapse file tree 4 files changed +6
-10
lines changed
nestjs-libraries/src/database/prisma/organizations Expand file tree Collapse file tree 4 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export const SettingsPopup: FC<{ getRef?: Ref<any> }> = (props) => {
3838 } , [ ] ) ;
3939
4040 const url = useSearchParams ( ) ;
41- const showLogout = ! url . get ( 'onboarding' ) ;
41+ const showLogout = ! url . get ( 'onboarding' ) || user ?. tier ?. current === "FREE" ;
4242
4343 const loadProfile = useCallback ( async ( ) => {
4444 const personal = await ( await fetch ( '/user/personal' ) ) . json ( ) ;
Original file line number Diff line number Diff line change 11import { NextResponse } from 'next/server' ;
22import type { NextRequest } from 'next/server' ;
3- import { fetchBackend } from '@gitroom/helpers/utils/custom.fetch.func' ;
43import { getCookieUrlFromDomain } from '@gitroom/helpers/subdomain/subdomain.management' ;
4+ import { internalFetch } from '@gitroom/helpers/utils/internal.fetch' ;
55
66// This function can be marked `async` if using `await` inside
77export async function middleware ( request : NextRequest ) {
@@ -68,13 +68,10 @@ export async function middleware(request: NextRequest) {
6868 try {
6969 if ( org ) {
7070 const { id } = await (
71- await fetchBackend ( '/user/join-org' , {
71+ await internalFetch ( '/user/join-org' , {
7272 body : JSON . stringify ( {
7373 org,
7474 } ) ,
75- headers : {
76- auth : authCookie ?. value ! ,
77- } ,
7875 method : 'POST' ,
7976 } )
8077 ) . json ( ) ;
Original file line number Diff line number Diff line change 1- import { loadVars } from '@gitroom/react/helpers/variable.context' ;
21
32export interface Params {
43 baseUrl : string ;
@@ -48,6 +47,6 @@ export const customFetch = (
4847
4948export const fetchBackend = customFetch ( {
5049 get baseUrl ( ) {
51- return loadVars ( ) . backendUrl ;
50+ return process . env . BACKEND_URL ! ;
5251 } ,
5352} ) ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class OrganizationService {
4646 }
4747
4848 async inviteTeamMember ( orgId : string , body : AddTeamMemberDto ) {
49- const timeLimit = dayjs ( ) . add ( 15 , 'minutes ' ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
49+ const timeLimit = dayjs ( ) . add ( 1 , 'hour ' ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
5050 const id = makeId ( 5 ) ;
5151 const url =
5252 process . env . FRONTEND_URL +
@@ -55,7 +55,7 @@ export class OrganizationService {
5555 await this . _notificationsService . sendEmail (
5656 body . email ,
5757 'You have been invited to join an organization' ,
58- `You have been invited to join an organization. Click <a href="${ url } ">here</a> to join.<br />The link will expire in 15 minutes .`
58+ `You have been invited to join an organization. Click <a href="${ url } ">here</a> to join.<br />The link will expire in 1 hour .`
5959 ) ;
6060 }
6161 return { url } ;
You can’t perform that action at this time.
0 commit comments