Skip to content

Commit

Permalink
Auth fix and upload test
Browse files Browse the repository at this point in the history
  • Loading branch information
datajohnson committed Nov 12, 2024
1 parent 8ca4b49 commit 302f935
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/api/@types/express/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ namespace Express {

isAuthenticated(): boolean;
}
export interface Response {
oidc?: any;
}
}
2 changes: 1 addition & 1 deletion src/api/routes/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions src/api/routes/recoveries-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 302f935

Please sign in to comment.