-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ban logs to DB, post & story delete on ban where content is log…
…ged to DB for unban requests Fixed clear cookies error, new logs middleware, new DB logs table, mod checks on separate non-blocking thread
- Loading branch information
1 parent
b831cd8
commit e9dd284
Showing
8 changed files
with
4,382 additions
and
3,183 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { Response } from "express"; | ||
|
||
const clearAllCookies = (res: Response) => { | ||
res.clearCookie("accessToken", { | ||
httpOnly: true, | ||
secure: true, | ||
sameSite: "none", | ||
}); | ||
try { | ||
return res.clearCookie("accessToken", { | ||
httpOnly: true, | ||
secure: true, | ||
sameSite: "none", | ||
}); | ||
} catch (error) { | ||
return console.log("Cookie clear failed!"); | ||
} | ||
}; | ||
|
||
export default clearAllCookies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { supabase } from "$/db/connect"; | ||
|
||
const logDetails = async (userId: number, imageUrl: string, type: string) => { | ||
const { error: logError } = await supabase | ||
.from("logs") | ||
.insert({ user_id: userId, img: imageUrl, type: type }); | ||
|
||
if (logError) return console.log(`Error during ${type} log!`); | ||
}; | ||
|
||
export default logDetails; |