Utkarsh Anand
BABetter Auth
•Created by Utkarsh Anand on 4/4/2025 in #help
How to revoke all sessions after reset password from forget password link?
I don't find any way to revoke all logged in sessions of a user after reset password from forget password link. I see there is an method
authClient.revokeSessions()
to do this but it need an loggedin sesison.
Also i think about one other solution to login user using the email and newPassword but there is no way to get the email from the forget password link.
Althought i can add an extra searchparam in the link before sending but i am looking for better way.5 replies
BABetter Auth
•Created by Utkarsh Anand on 3/27/2025 in #help
Not able to get session type while using auth.api.getSession({headers: headers()})
I have an turborepo setup with below packages, i am trying to migrate from "next-auth" to "better-auth". I have all auth related code in seperate internal package "packages/auth".
I facing very strange issue on which i am stuck from last 2 days. My problem is related to getting types for session, I am using
auth.api.getSession
to get session on serverside.
I have tried everything, even when i am using this in auth.ts file itself it is not giving types. I have tried to use differnt tsconfig.
Please help me.
My packages:
usage:
export const session = await auth.api.getSession({ header: headers() });
type of session object:
type of auth.api.getSession
on hovering .getSession
:
my tsconfig:
7 replies