fix: address coderabbit review on #6214
- Remove invalid null return from session callback (must return session object) - Prevent admin from disabling their own account (guard with isSelf check) - Hide disable UI when viewing own profile - Add user existence check to changeDisabled endpoint - Add OpenAPI metadata to changeDisabled mutation
This commit is contained in:
1 parent
fbac0c8752
commit
39a1a3695e
4 files changed
+35
-12
No files matched your search
@@ -47,14 +47,9 @@ export const createSessionCallback = (db: Database): NextAuthCallbackOf<"session
|
||||
where: eq(users.id, user.id),
|
||||
columns: {
|
||||
colorScheme: true,
|
||||
disabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (additionalProperties?.disabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
...session,
|
||||
user: {
|
||||
|
||||
Reference in new issue
Block a user