[GH-ISSUE #939] stopImpersonating gives 404 #25833

Closed
opened 2026-04-17 16:06:20 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @vedantroy on GitHub (Dec 18, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/939

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Use the admin plugin, and try stopping impersonation.

Current vs. Expected behavior

When I call authClient.admin.stopImpersonating, I get a 404 error.

      const r = await authClient.admin.stopImpersonating();

image

This error does not happen when I initiate an impersonation.

What version of Better Auth are you using?

^1.0.22

Provide environment information

- Chrome
- MacOS, `Darwin 24.1.0 arm64 arm`

Which area(s) are affected? (Select all that apply)

Backend, Client

Auth config (if applicable)

export const auth = betterAuth({
	database: new Database(DATABASE_URL),
	plugins: [admin()],
	socialProviders: {
		google: {
			clientId: process.env.AUTH_GOOGLE_ID as string,
			clientSecret: process.env.AUTH_GOOGLE_SECRET as string,
		},
	},
	trustedOrigins,
});

Additional context

No response

Originally created by @vedantroy on GitHub (Dec 18, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/939 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce Use the `admin` plugin, and try stopping impersonation. ### Current vs. Expected behavior When I call `authClient.admin.stopImpersonating`, I get a 404 error. ``` const r = await authClient.admin.stopImpersonating(); ``` ![image](https://github.com/user-attachments/assets/e0f079bf-fa69-4217-9ad0-735753554026) This error does not happen when I initiate an impersonation. ### What version of Better Auth are you using? ^1.0.22 ### Provide environment information ```bash - Chrome - MacOS, `Darwin 24.1.0 arm64 arm` ``` ### Which area(s) are affected? (Select all that apply) Backend, Client ### Auth config (if applicable) ```typescript export const auth = betterAuth({ database: new Database(DATABASE_URL), plugins: [admin()], socialProviders: { google: { clientId: process.env.AUTH_GOOGLE_ID as string, clientSecret: process.env.AUTH_GOOGLE_SECRET as string, }, }, trustedOrigins, }); ``` ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-17 16:06:21 -05:00
Author
Owner

@vedantroy commented on GitHub (Dec 18, 2024):

Oh, maybe the issue is that the client has the method, but the server has not yet implemented it: https://github.com/better-auth/better-auth/pull/883

<!-- gh-comment-id:2552013545 --> @vedantroy commented on GitHub (Dec 18, 2024): Oh, maybe the issue is that the client has the method, but the server has not yet implemented it: https://github.com/better-auth/better-auth/pull/883
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#25833