Skip to content

Commit 1cc5f32

Browse files
committed
fix(axiom): user unable to edit their own profile due to permission issues
1 parent a28ce75 commit 1cc5f32

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/db/access/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ export const adminsAndUser: IsAuthenticated = ({ req: { user } }) => {
1616
return { id: user.id };
1717
};
1818

19-
export const isSameUser: IsAuthenticated = ({ req: { user }, id }) =>
20-
user?.id === id;
19+
export const isSameUser: IsAuthenticated = ({ req: { user } }) => {
20+
if (!user) return false;
21+
return {
22+
id: { equals: user.id }
23+
};
24+
};
2125

2226
export const anyone: IsAuthenticated = () => true;
2327

0 commit comments

Comments
 (0)