mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Fix/179 pass allowed errors to nested crud handlers (#208)
* Team invitation (#171) * team invitation wip * implemented handler * team invitation callback wip * added team invitation frontend * fixed listCurrentUserTeamPermissions * added team invitation email template * fixed bugs * fixed verification code handler * added more checks to team invitation verification * fixed team invitation page * restructured verification code handler * fixed frontend * fixed team invitation tests * added more team invitation test * fixed bug * added migration file * removed unused code * Allow Next.js version `latest` in package.json * Fix typo * Update error message * Remove unnecessary console.warn * Updated "edit this page" button * Hide unsupported properties from docs * OAuth token tests * Fix typo * added create user button (#173) * Create SECURITY.md * Export button in tables * Export all pages of tables * Update security policy * Fix docs typo * More docs typos * Improved user creation handlers * Fix: Improve error handling for Server API (#170) * Added entity checks to provide better errors in API for 'server' access type * Removed 'ensureUserTeamPermissionExist', changed permissionId type to string in 'ensureUserHasTeamPermission' * added different error types for user team permission --------- Co-authored-by: Fahad Khan <fahad.khan@net-mon.net> Co-authored-by: Zai Shi <zaishi00@outlook.com> * Sign up restriction button on dashboard Fix #66, #74 * Fix type error * TOTP 2FA endpoints * TOTP MFA components * Improved description for disabling sign ups * Added 'allowedErrorTypes' for error propagation --------- Co-authored-by: Zai Shi <zaishi00@outlook.com> Co-authored-by: Stan Wohlwend <n2d4xc@gmail.com> Co-authored-by: Fahad Khan <fahad.khan@net-mon.net>
This commit is contained in:
parent
b5009ca454
commit
57bc32d063
@ -333,7 +333,7 @@ export const currentUserCrudHandlers = createLazyProxy(() => createCrudHandlers(
|
||||
return await usersCrudHandlers.adminRead({
|
||||
project: auth.project,
|
||||
user_id: auth.user?.id ?? throwErr(new KnownErrors.CannotGetOwnUserWithoutUser()),
|
||||
allowedErrorTypes: [Error],
|
||||
allowedErrorTypes: [StatusError]
|
||||
});
|
||||
},
|
||||
async onUpdate({ auth, data }) {
|
||||
@ -345,14 +345,14 @@ export const currentUserCrudHandlers = createLazyProxy(() => createCrudHandlers(
|
||||
project: auth.project,
|
||||
user_id: auth.user?.id ?? throwErr(new KnownErrors.CannotGetOwnUserWithoutUser()),
|
||||
data,
|
||||
allowedErrorTypes: [Error],
|
||||
allowedErrorTypes: [StatusError]
|
||||
});
|
||||
},
|
||||
async onDelete({ auth }) {
|
||||
return await usersCrudHandlers.adminDelete({
|
||||
project: auth.project,
|
||||
user_id: auth.user?.id ?? throwErr(new KnownErrors.CannotGetOwnUserWithoutUser()),
|
||||
allowedErrorTypes: [Error],
|
||||
allowedErrorTypes: [StatusError]
|
||||
});
|
||||
},
|
||||
}));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user