-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
feat: Email blacklist for api and sign up #17724
base: main
Are you sure you want to change the base?
Conversation
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (11/18/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add foundation team as reviewer" took an action on this PR • (11/18/24)1 reviewer was added to this PR based on Keith Williams's automation. |
@@ -42,6 +43,10 @@ export const verifyApiKey: NextMiddleware = async (req, res, next) => { | |||
req.userId = apiKey.userId; | |||
const { isAdmin, scope } = await isAdminGuard(req); | |||
|
|||
const userIsLockedOrBlocked = await isLockedOrBlocked(req); | |||
|
|||
if (userIsLockedOrBlocked) return res.status(401).json({ error: "User is locked or blocked" }); |
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.
Let's make this more generic. "You are not authorized to perform this request."
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.
This adds another round trip to the DB on every request. Going to refactor it to not have this.
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
What does this PR do?
PR adds blacklist.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Add an email domain to blacklist. Try to signup (account should get locked).
Create an account:
Lock account in DB. Try to use api key
Checklist