-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add endpoint to refresh auth token #981
Changes from all commits
043698e
9f861f9
861adc0
19e47ff
7c24136
7f95b06
af685f3
225938d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ import mjml2html from "mjml"; | |
|
||
// Settings Service and dependencies | ||
import SettingsService from "./service/settingsService.js"; | ||
import AppSettings from "../db/models/AppSettings.js"; | ||
import AppSettings from "./db/models/AppSettings.js"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification AppSettings.js import path is invalid! 🔗 Analysis chainYo, check that import path, homie! Aight, so we switched up the import path for AppSettings. It's like we're tryin' to find mom's spaghetti in a new kitchen, you feel me? Make sure this new path "./db/models/AppSettings.js" is legit and we ain't gonna trip when we try to serve up those settings. Let's run this script to make sure we ain't lost in the sauce: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Yo, we're gonna check if that AppSettings file is where we think it is
# First, let's see if the file exists
if [ -f "./db/models/AppSettings.js" ]; then
echo "AppSettings.js is right where it should be, fam!"
else
echo "Uh oh, AppSettings.js is MIA. We might have a problem, dawg."
fi
# Now, let's make sure it's got the goods
grep -q "export default" "./db/models/AppSettings.js" && echo "AppSettings is exportin' something, we good!" || echo "Hold up, AppSettings ain't exportin'. We might need to fix that, yo."
Length of output: 437 |
||
|
||
import db from "./db/mongo/MongoDB.js"; | ||
const SERVICE_NAME = "Server"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Yo, dawg! Your token refresh game's weak, knees shaky!
Listen up, homie! Your token refresh function's got more issues than Eminem's got rhymes. Let's break it down:
You're lettin' expired tokens slide with
ignoreExpiration: true
. That's like leaving your front door wide open in the hood! Fix that security hole, fam!You're using
delete
on lines 221-222 like it's going out of style. That's slower than my grandma's dial-up! Try setting those props toundefined
instead, it'll make your code run faster than Usain Bolt!Your error handling's as basic as vanilla ice cream. Spice it up with some proper logging, ya feel me?
Here's how you can clean up your act:
Don't let your code be a one-hit wonder, make it a classic!
📝 Committable suggestion
🧰 Tools
🪛 Biome