complete integration of direct share link as discussed in #35

This commit is contained in:
Milo Schwartz
2025-01-12 13:43:16 -05:00
parent bfd1b21f9c
commit a2ed7c7117
15 changed files with 215 additions and 37 deletions

View File

@@ -6,7 +6,8 @@ export function pullEnv(): Env {
nextPort: process.env.NEXT_PORT as string,
externalPort: process.env.SERVER_EXTERNAL_PORT as string,
sessionCookieName: process.env.SESSION_COOKIE_NAME as string,
resourceSessionCookieName: process.env.RESOURCE_SESSION_COOKIE_NAME as string
resourceSessionCookieName: process.env.RESOURCE_SESSION_COOKIE_NAME as string,
resourceAccessTokenParam: process.env.RESOURCE_ACCESS_TOKEN_PARAM as string
},
app: {
environment: process.env.ENVIRONMENT as string,

View File

@@ -1,3 +1,5 @@
import { pullEnv } from "./pullEnv";
export function constructShareLink(
resourceId: number,
id: string,
@@ -5,3 +7,12 @@ export function constructShareLink(
) {
return `${window.location.origin}/auth/resource/${resourceId}?token=${id}.${token}`;
}
export function constructDirectShareLink(
param: string,
resourceUrl: string,
id: string,
token: string
) {
return `${resourceUrl}?${param}=${id}.${token}`;
}

View File

@@ -8,6 +8,7 @@ export type Env = {
nextPort: string;
sessionCookieName: string;
resourceSessionCookieName: string;
resourceAccessTokenParam: string;
},
email: {
emailEnabled: boolean;