summaryrefslogtreecommitdiff
path: root/app/src/routes/login
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/routes/login')
-rw-r--r--app/src/routes/login/+page.server.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/routes/login/+page.server.ts b/app/src/routes/login/+page.server.ts
index d011af9..b64e190 100644
--- a/app/src/routes/login/+page.server.ts
+++ b/app/src/routes/login/+page.server.ts
@@ -4,7 +4,7 @@ import { fail, redirect } from "@sveltejs/kit";
import type { Actions } from "./$types";
export const actions = {
- default: async ({ url, cookies, request, locals: { dbConn } }) => {
+ default: async ({ url, cookies, request, locals: { dbClient: dbClient } }) => {
const formData = Object.fromEntries(await request.formData()) as {
email?: string;
password?: string;
@@ -13,7 +13,7 @@ export const actions = {
return fail(400, { failure: true, error: "Du skal udfylde alle felterne!" });
}
- const user = await getUser(dbConn, formData.email, formData.password);
+ const user = await getUser(dbClient, formData.email, formData.password);
if (!user) {
// It's important that we don't leak _which_ value is missing.
return fail(404, { failure: true, error: "Forkert email/kodeord kombi!" });
@@ -21,7 +21,7 @@ export const actions = {
console.debug("Found user %o", user);
// The user has proven that they posses the right credentials. In return they gain a session token, which can be used to authenticate future requests.
- const session = await createSession(dbConn, user.id);
+ const session = await createSession(dbClient, user.id);
cookies.set("SESSION_ID", session.token, {
path: "/",
secure: true,