createAndSetSession(): Promise<void>
Creates a new session for a user and sets the session cookie in the provided cookies object.
▶import type { Actions, PageServerLoad } from "./$types";
import { lucia } from "$lib/server/auth";
import * as mod from "@jhenbert/byteminds-util";
import type { Actions, PageServerLoad } from "./$types"; import { lucia } from "$lib/server/auth"; import * as mod from "@jhenbert/byteminds-util";
export const actions: Actions = { login: async ({ request, url, cookies }) => {
//some of your code
await mod.luciaCreateAndSetSession(lucia, existingUser.id, cookies); },
Promise<void>
- A promise that resolves when the session and cookie have been successfully created and set.