Document to disable saving of IP Address #1178

Closed
opened 2026-03-13 08:26:39 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @BjoernRave on GitHub (May 7, 2025).

Is this suited for github?

  • Yes, this is suited for github

I think currently its not possible to opt out to saving ip addresses. I think in the EU you would have to disclose this, as we are storing it in direct relation to the user object, which make the ip address personal data

Describe the solution you'd like

easy boolean to opt out.

Describe alternatives you've considered

One problem I am seeing is rate limiting, throttling I guess, not sure how to deal with that, maybe you just dont have it then

Additional context

No response

Originally created by @BjoernRave on GitHub (May 7, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I think currently its not possible to opt out to saving ip addresses. I think in the EU you would have to disclose this, as we are storing it in direct relation to the user object, which make the ip address personal data ### Describe the solution you'd like easy boolean to opt out. ### Describe alternatives you've considered One problem I am seeing is rate limiting, throttling I guess, not sure how to deal with that, maybe you just dont have it then ### Additional context _No response_
Author
Owner

@moreorover commented on GitHub (May 8, 2025):

I think you can do the following already based on the source code:

https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/utils/get-request-ip.ts#L8

export const auth = betterAuth({
	database: prismaAdapter(prisma, {
		provider: "postgresql",
	}),
	emailAndPassword: {
		enabled: true,
		autoSignIn: false,
	},
	plugins: [nextCookies()],
+	advanced: {
+		ipAddress: {
+			disableIpTracking: true,
+		},
+	},
});
@moreorover commented on GitHub (May 8, 2025): I think you can do the following already based on the source code: https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/utils/get-request-ip.ts#L8 ```diff export const auth = betterAuth({ database: prismaAdapter(prisma, { provider: "postgresql", }), emailAndPassword: { enabled: true, autoSignIn: false, }, plugins: [nextCookies()], + advanced: { + ipAddress: { + disableIpTracking: true, + }, + }, }); ```
Author
Owner

@BjoernRave commented on GitHub (May 8, 2025):

Ah, you're right. Then this issue should more be about documenting this, as I havent found anything in the docs regarding this. Especially around the consequences this has for me

@BjoernRave commented on GitHub (May 8, 2025): Ah, you're right. Then this issue should more be about documenting this, as I havent found anything in the docs regarding this. Especially around the consequences this has for me
Author
Owner

@ronilsonalves commented on GitHub (May 8, 2025):

Ah, you're right. Then this issue should more be about documenting this, as I havent found anything in the docs regarding this. Especially around the consequences this has for me

https://www.better-auth.com/docs/reference/options#advanced

@ronilsonalves commented on GitHub (May 8, 2025): > Ah, you're right. Then this issue should more be about documenting this, as I havent found anything in the docs regarding this. Especially around the consequences this has for me https://www.better-auth.com/docs/reference/options#advanced
Author
Owner

@BjoernRave commented on GitHub (May 8, 2025):

okay, my fault :D

@BjoernRave commented on GitHub (May 8, 2025): okay, my fault :D
Author
Owner

@vladshcherbin commented on GitHub (May 15, 2025):

@BjoernRave keep in mind disableIpTracking completely disables rate limiting

@vladshcherbin commented on GitHub (May 15, 2025): @BjoernRave keep in mind `disableIpTracking` completely disables rate limiting
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1178