mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-25 08:31:37 -05:00
fix: missing ctx on after hooks
This commit is contained in:
@@ -201,13 +201,14 @@ export function getEndpoints<
|
||||
for (const plugin of options.plugins || []) {
|
||||
if (plugin.hooks?.after) {
|
||||
for (const hook of plugin.hooks.after) {
|
||||
// @ts-expect-error - returned is not in the context type
|
||||
c.returned = response;
|
||||
// @ts-expect-error - endpoint is not in the context type
|
||||
c.endpoint = value;
|
||||
const ctx = {
|
||||
...context,
|
||||
context: c,
|
||||
context: {
|
||||
...c,
|
||||
...context.context,
|
||||
endpoint: value,
|
||||
returned: response,
|
||||
},
|
||||
};
|
||||
const match = hook.matcher(ctx);
|
||||
if (match) {
|
||||
|
||||
Reference in New Issue
Block a user