refactor-login-page #7

Merged
jared merged 61 commits from refactor-login-page into main 2025-06-18 13:10:25 +02:00
2 changed files with 10 additions and 4 deletions
Showing only changes of commit 52222f0236 - Show all commits

View File

@@ -1,5 +1,6 @@
import path from 'path';
import { writeFile } from 'fs/promises';
import { Buffer } from 'buffer';
import { createReadStream } from 'fs';
/** import Minio from 'minio'; */
import { Readable } from 'stream';
@@ -36,7 +37,13 @@ export const actions = {
const url = await client.presignedPutObject('tatort', objectName);
// enter code
// store code in S3
// tatort/<vorgang>/__perm__
const code_filename = '__perm__';
const buf = Buffer.from(code, 'utf-8');
const code_stream = Readable.from(buf);
const code_path = `${vorgang}/${code_filename}`;
await client.putObject('tatort', code_path, code_stream);
return { url };
},
@@ -109,8 +116,5 @@ export const actions = {
return { etag, error };
//await writeFile(filePath, Buffer.from(await data.file.arrayBuffer()));
},
get_code: async ({ request }) => {
console.log('TO-DO');
}
};

View File

@@ -15,6 +15,8 @@ export async function GET({ params }) {
const name = data.name.slice(prefix.length);
if (name === 'config.json') return;
// zugangscode datei
if (name === '__perm__') return;
controller.enqueue(`${JSON.stringify({ ...data, name, prefix })}\n`);
});