Update CSRF protection and modify database types

The CSRF protection in middleware has been re-implemented with `@edge-csrf/nextjs`, to catch and handle CSRF errors more effectively. Additionally, some parameters are renamed and functions are added in `database.types.ts` for better role management. The dependency in `package.json` has also been updated to reflect the changes.
This commit is contained in:
giancarlo
2024-04-22 11:27:54 +08:00
parent acd5ad08f9
commit e2503333e2
5 changed files with 42 additions and 15 deletions

View File

@@ -667,7 +667,7 @@ export type Database = {
can_action_account_member: {
Args: {
target_team_account_id: string
user_id: string
target_user_id: string
}
Returns: boolean
}
@@ -747,6 +747,10 @@ export type Database = {
Args: Record<PropertyKey, never>
Returns: Json
}
get_upper_system_role: {
Args: Record<PropertyKey, never>
Returns: string
}
has_more_elevated_role: {
Args: {
target_user_id: string
@@ -770,6 +774,14 @@ export type Database = {
}
Returns: boolean
}
has_same_role_hierarchy_level: {
Args: {
target_user_id: string
target_account_id: string
role_name: string
}
Returns: boolean
}
is_account_owner: {
Args: {
account_id: string