Hola Soy Yigs
Hola Soy Yigs
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
impersonate user isn't meant to do this. to update user from admin make a new endpoint that you can call with the user id and update their info.
Could you tell me what the appropriate use cases would be for this feature? I feel like the official documentation doesn't provide any use case examples.
Make sure the logged in user is admin. We'll add update endpoint for a user soon in the admin plugin
Hehe, after all I'll have to get my hands dirty for now waiting for this new feature, it would be quite useful to consider a set of raw operations in this and the rest of the utilities, thx ❤️
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
Okay, with my admin user, I'm trying to update the data for a regular user with the "user" role using the "Impersonate User" method. As I mentioned, I'm using better-auth out-of-the-box using openapi-ts as a test, since in the future I plan to use another platform to consume better-auth as a microservice for authentication and user management. As I mentioned in the previous assets in the chat, when using the "Impersonate User" method, on the first load of my page, it correctly retrieves the information for the user I want to update. However, when I reload the page, I'm stuck with the user persona I need to modify, and it doesn't allow me to perform admin operations again.
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
ok await me one moment
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
🥲
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
Basically, I have everything by default as indicated in the documentation. These are the logs of the actions performed in the first video I attached. I would like to know if I am making myself understood so I can reformulate what happened.
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
export const auth = betterAuth({
appName: "better-auth-test",
database: new LibsqlDialect({
url: `file:${join(__dirname, "/database/better-auth.sqlite")}`,
}),
trustedOrigins: getEnvArray("BETTER_AUTH_TRUSTED_ORIGINS"),
plugins: [
admin({

}),
organization({
teams: {
enabled: true,
maximumTeams: 10,
allowRemovingAllTeams: true,
},
allowUserToCreateOrganization: async (user) => {
const current_user = await findUser(user.id);
if (!current_user)
throw new Error("[allowUserToCreateOrganization]: USER NOT FOUND");

return current_user.role === "admin";
},
}),
magicLink(magicLinkOptions),
openAPI(),
],
emailAndPassword: { enabled: true, requireEmailVerification: true },
logger: { disabled: false },
emailVerification: emailVerificationOptions,
});
export const auth = betterAuth({
appName: "better-auth-test",
database: new LibsqlDialect({
url: `file:${join(__dirname, "/database/better-auth.sqlite")}`,
}),
trustedOrigins: getEnvArray("BETTER_AUTH_TRUSTED_ORIGINS"),
plugins: [
admin({

}),
organization({
teams: {
enabled: true,
maximumTeams: 10,
allowRemovingAllTeams: true,
},
allowUserToCreateOrganization: async (user) => {
const current_user = await findUser(user.id);
if (!current_user)
throw new Error("[allowUserToCreateOrganization]: USER NOT FOUND");

return current_user.role === "admin";
},
}),
magicLink(magicLinkOptions),
openAPI(),
],
emailAndPassword: { enabled: true, requireEmailVerification: true },
logger: { disabled: false },
emailVerification: emailVerificationOptions,
});
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
No description
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
No description
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
Could you give me some guidance on how to implement what you mentioned to activate impersonation permissions?
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
No description
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
It's funny because in the video you can see that in the first consultation it does allow identity theft, but in the next consultation it doesn't.
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
I forgot to mention that after reloading the screen it stays in the user persona and I can't perform administrator operations on the panel again hehe
20 replies
BABetter Auth
Created by Hola Soy Yigs on 4/20/2025 in #help
Client-side user impersonation in Better-Auth with OpenAPI-TS: Why does it fail?
No description
20 replies
BABetter Auth
Created by Hola Soy Yigs on 11/27/2024 in #bug-reports
Example Support Auth Remix.js
50 replies
BABetter Auth
Created by Hola Soy Yigs on 11/27/2024 in #bug-reports
Example Support Auth Remix.js
I understand your point of view on how I could interconnect applications through tokenization strategies or similar, but I also find it interesting how these implementations would work directly from the server side, either for some use case (like mine), or directly mere curiosity
50 replies
BABetter Auth
Created by Hola Soy Yigs on 11/27/2024 in #bug-reports
Example Support Auth Remix.js
Hello, how are you, I understand your point but in this case if we pay attention to the detail the cookie is being saved with a "__session" tag which is the REMIX AUTH standard, what happened is that in a moment of madness I tried to remix these authentication methods, which was not possible since they both established the tokens in their own way, for that reason I discarded remix-auth and took a more manual approach for verification of sessions making redundancy a remix of the headers y better-auth
50 replies
BABetter Auth
Created by Hola Soy Yigs on 11/27/2024 in #bug-reports
Example Support Auth Remix.js
his taking into account that we want to manage everything on the server side
50 replies
BABetter Auth
Created by Hola Soy Yigs on 11/27/2024 in #bug-reports
Example Support Auth Remix.js
No description
50 replies
BABetter Auth
Created by Hola Soy Yigs on 11/27/2024 in #bug-reports
Example Support Auth Remix.js
Hello everyone, @bekacru after several trial and error attempts I think that using the api and literally the remix of the remix.js headers to make a bypass between better-auth and the remix server, my solution at the moment to be able to use the better-auth authentication service was this thing a bit archaic since the better-auth-client is not able to return the response to be able to manipulate the request at will and avoid this code that It could be visually ugly 😛
50 replies
BABetter Auth
Created by Hola Soy Yigs on 11/27/2024 in #bug-reports
Example Support Auth Remix.js
No description
50 replies