mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-02 12:26:43 -05:00
feat: getActions from client plugins to include clientOptions in get user client config (#2333)
* update: `getActions` from client plugins to include `clientOptions` in get user client config * update: rename `clientOptions` to `options` * chore: lint
This commit is contained in:
@@ -100,7 +100,10 @@ export const getClientConfig = (options?: ClientOptions) => {
|
||||
|
||||
for (const plugin of plugins) {
|
||||
if (plugin.getActions) {
|
||||
Object.assign(pluginsActions, plugin.getActions?.($fetch, $store));
|
||||
Object.assign(
|
||||
pluginsActions,
|
||||
plugin.getActions?.($fetch, $store, options),
|
||||
);
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -36,7 +36,14 @@ export interface BetterAuthClientPlugin {
|
||||
/**
|
||||
* Custom actions
|
||||
*/
|
||||
getActions?: ($fetch: BetterFetch, $store: Store) => Record<string, any>;
|
||||
getActions?: (
|
||||
$fetch: BetterFetch,
|
||||
$store: Store,
|
||||
/**
|
||||
* better-auth client options
|
||||
*/
|
||||
options: ClientOptions | undefined,
|
||||
) => Record<string, any>;
|
||||
/**
|
||||
* State atoms that'll be resolved by each framework
|
||||
* auth store.
|
||||
|
||||
Reference in New Issue
Block a user