Filippo
Filippo
BABetter Auth
Created by Filippo on 4/23/2025 in #help
How to log in from the server
Yes I'm using SvelteKit, You mean like this?
const response = await auth.api.signInEmail({
body: { email, password },
asResponse: true,
headers: request.headers
});
const response = await auth.api.signInEmail({
body: { email, password },
asResponse: true,
headers: request.headers
});
12 replies
BABetter Auth
Created by Filippo on 4/23/2025 in #help
How to log in from the server
You mean:
import { auth } from "$lib/auth";

export const load = async ({ request, locals }) => {
const session = await auth.api.getSession({
headers: await headers()
})
import { auth } from "$lib/auth";

export const load = async ({ request, locals }) => {
const session = await auth.api.getSession({
headers: await headers()
})
?
12 replies
BABetter Auth
Created by Filippo on 4/23/2025 in #help
How to log in from the server
Thank you, I know but I'm trying to use the server side because I do operations in a formAction, I tried client side and it kind of works, I'd like to know how to do it server side.
12 replies