diff --git a/src/api/@types/express/index.d.ts b/src/api/@types/express/index.d.ts index 780c25c..b268a81 100644 --- a/src/api/@types/express/index.d.ts +++ b/src/api/@types/express/index.d.ts @@ -7,4 +7,7 @@ namespace Express { isAuthenticated(): boolean; } + export interface Response { + oidc?: any; + } } \ No newline at end of file diff --git a/src/api/routes/auth.ts b/src/api/routes/auth.ts index 6e64016..0bc8847 100644 --- a/src/api/routes/auth.ts +++ b/src/api/routes/auth.ts @@ -44,7 +44,7 @@ export function configureAuthentication(app: Express) { }); app.get("/api/auth/login", (req, res) => - req.oidc.login({ + res.oidc.login({ returnTo: "/api/auth/profile", authorizationParams: { redirect_uri: BASE_URL + "/callback" diff --git a/src/api/routes/recoveries-router.ts b/src/api/routes/recoveries-router.ts index 729d496..65c7e73 100644 --- a/src/api/routes/recoveries-router.ts +++ b/src/api/routes/recoveries-router.ts @@ -60,9 +60,12 @@ recoveriesRouter.post( const file = data.docNames.length == 1 ? files : files[inx]; const docName = data.docNames[inx]; - console.log("UPLOAD", file); + console.log("UPLOAD", file.length, file); + + const buffer = await db.raw(`CAST('${file}' AS VARBINARY(MAX))`); + + console.log("BUFER LENGTH", buffer.length) - const buffer = file.data; // db.raw(`CAST('${file}' AS VARBINARY(MAX))`); const backupDoc = await db("BackUpDocs") .select("documentID") .where("recoveryID", recoveryID)