vorgang accessible via url
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { fail, redirect } from '@sveltejs/kit';
|
||||
import { BUCKET, client } from '$lib/minio';
|
||||
import { BUCKET, client, TOKENFILENAME } from '$lib/minio';
|
||||
import { checkIfExactDirectoryExists } from './s3ClientService';
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ export const redirectIfVorgangExists = async (request: Request) => {
|
||||
});
|
||||
}
|
||||
|
||||
redirect(303, `/list/${caseId}`);
|
||||
redirect(303, `/list/${caseId}?token=${caseToken}`);
|
||||
};
|
||||
|
||||
export const getVorgangByCaseId = ({ params }) => {
|
||||
@@ -76,14 +76,13 @@ export const getVorgangByCaseId = ({ params }) => {
|
||||
});
|
||||
};
|
||||
|
||||
const hasValidToken = async (caseId: string, caseToken: string) => {
|
||||
const tokenFileName = '__perm__';
|
||||
const objPath = `${caseId}/${tokenFileName}`;
|
||||
export const hasValidToken = async (caseId: string, caseToken: string) => {
|
||||
const objPath = `${caseId}/${TOKENFILENAME}`;
|
||||
|
||||
try {
|
||||
if (!caseToken) return false;
|
||||
|
||||
const res = await client.getObject('tatort', objPath);
|
||||
const res = await client.getObject(BUCKET, objPath);
|
||||
|
||||
const savedToken = await new Response(res).text();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user