Any idea on how to implement suspicious login detection?

I was thinking on using the database hook on session creation but if there is any other way that is better then please let me know
11 Replies
chunkbanned
chunkbannedOP2mo ago
Bump
Amari
Amari2mo ago
GitHub
GitHub - GeKorm/better-auth-harmony: Normalize emails/phone numbers...
Normalize emails/phone numbers and block throwaway domains with Better Auth - GeKorm/better-auth-harmony
chunkbanned
chunkbannedOP2mo ago
I mean like, when an account is logged in from another location it sends a notification etc
Amari
Amari2mo ago
something like this rightt?
chunkbanned
chunkbannedOP2mo ago
You know when your accounts been hacked on google and they login and then you get a notification from them saying your accounts been breached, something like that
Amari
Amari2mo ago
They dont actually know if your accounts been hacked
chunkbanned
chunkbannedOP2mo ago
I know that, but when it’s been logged in from a different location etc
Amari
Amari2mo ago
You could use database hooks for that
databaseHooks: {
session: {
create: {
before: async (session) => {
///

},
},
},
},
databaseHooks: {
session: {
create: {
before: async (session) => {
///

},
},
},
},
chunkbanned
chunkbannedOP2mo ago
Yeah that was my plan, I was just seeing if there was anyway I could do it better
Amari
Amari2mo ago
Just create an issue on github
chunkbanned
chunkbannedOP2mo ago
Okay

Did you find this page helpful?