feat: add Clerk Auth #43

Merged
piopi merged 4 commits from please-god-help-us into master 2025-01-04 21:24:47 -05:00
17 changed files with 152 additions and 248 deletions

6
.env
View file

@ -4,4 +4,8 @@ TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=
# PRISMA
DATABASE_URL="postgres://hestia:test123@localhost:5432/hestia"
DATABASE_URL="postgres://hestia:test123@localhost:5432/hestia"
# CLERK
BenjaminPalko commented 2025-01-02 11:18:51 -05:00 (Migrated from github.com)
Review

thats a bit wordy

thats a bit wordy
piopi commented 2025-01-02 20:08:15 -05:00 (Migrated from github.com)
Review

Making sure no one try to change it

Making sure no one try to change it
PUBLIC_CLERK_PUBLISHABLE_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead
CLERK_SECRET_KEY=secret_do_not_commit_or_change_this_create_.env.local_instead

1
.gitignore vendored
View file

@ -12,6 +12,7 @@ node_modules
# OS
.DS_Store
Thumbs.db
.idea
BenjaminPalko commented 2025-01-02 11:18:14 -05:00 (Migrated from github.com)
Review

😂

😂
# Vite
vite.config.js.timestamp-*

BIN
bun.lockb

Binary file not shown.

View file

@ -3,10 +3,10 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "bun validate-env && bun database:up && bun prisma:push && vite dev",
"dev": "bun validate-env && bun database:up && bun prisma:generate && vite dev",
"build": "vite build",
"build-storybook": "storybook build",
"database:up": "docker compose -p hestia -f devops/docker-compose.dev.yml up -d && docker compose -p hestia -f devops/docker-compose.dev.yml -f devops/docker-compose.wait.yml run --rm wait -c hestia-database:5432",
"database:up": "docker compose -p hestia -f devops/docker-compose.dev.yml up -d && docker compose -p hestia -f devops/docker-compose.dev.yml -f devops/docker-compose.wait.yml run --rm wait -c hestia-database:5432 && bun prisma:push",
"database:down": "docker compose -p hestia -f devops/docker-compose.dev.yml down",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
@ -65,19 +65,19 @@
"vitest": "^2.0.4"
},
"dependencies": {
"@clerk/backend": "1.21.4",
"@clerk/themes": "^2.2.3",
"@flaticon/flaticon-uicons": "^3.3.1",
"@inlang/paraglide-sveltekit": "^0.15.0",
"@lucia-auth/adapter-prisma": "^4.0.1",
"@pothos/core": "^4.3.0",
"@pothos/plugin-prisma": "^4.4.0",
"@prisma/client": "6.0.1",
"@tailwindcss/typography": "^0.5.15",
"clerk-sveltekit": "https://pkg.pr.new/wobsoriano/clerk-sveltekit@ca15d4e",
"dayjs": "^1.11.13",
"eslint_d": "^14.3.0",
"graphql": "^16.9.0",
"graphql-yoga": "^5.10.4",
"lucia": "^3.2.2",
"oslo": "^1.2.1",
"pino": "^9.5.0",
"pino-pretty": "^13.0.0",
"tailwind-merge": "^2.5.5",

View file

@ -0,0 +1,24 @@
/*
Warnings:
- You are about to drop the column `password` on the `User` table. All the data in the column will be lost.
- You are about to drop the `Session` table. If the table is not empty, all the data it contains will be lost.
- A unique constraint covering the columns `[clerkId]` on the table `User` will be added. If there are existing duplicate values, this will fail.
- Added the required column `clerkId` to the `User` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "Session" DROP CONSTRAINT "Session_userId_fkey";
-- DropIndex
DROP INDEX "User_email_key";
-- AlterTable
ALTER TABLE "User" DROP COLUMN "password",
ADD COLUMN "clerkId" TEXT NOT NULL;
-- DropTable
DROP TABLE "Session";
-- CreateIndex
CREATE UNIQUE INDEX "User_clerkId_key" ON "User"("clerkId");

View file

@ -15,24 +15,12 @@ datasource db {
}
model User {
id String @id @default(uuid())
id String @id @default(uuid())
clerkId String @unique
email String? @unique
name String
password String
posts Post[]
sessions Session[]
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}
model Session {
id String @id @default(uuid())
expiresAt DateTime
user User @relation(references: [id], fields: [userId])
userId String
email String?
name String
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt

7
src/app.d.ts vendored
View file

@ -5,8 +5,11 @@ declare global {
namespace App {
// interface Error {}
interface Locals {
user: import('lucia').User | null;
session: import('lucia').Session | null;
auth: {
userId?: string;
orgId?: string | null;
sessionId?: string;
};
}
// interface PageData {}
// interface PageState {}

3
src/hooks.server.ts Normal file
View file

@ -0,0 +1,3 @@
import { withClerkHandler } from 'clerk-sveltekit/server';
export const handle = withClerkHandler();
BenjaminPalko commented 2025-01-02 16:24:50 -05:00 (Migrated from github.com)
Review
https://github.com/wobsoriano/clerk-sveltekit?tab=readme-ov-file#configure-the-server-hook
piopi commented 2025-01-02 20:03:34 -05:00 (Migrated from github.com)
Review

I am using UI components from the lib so no headless

I am using UI components from the lib so no headless
piopi commented 2025-01-02 20:11:02 -05:00 (Migrated from github.com)
Review

Oh the part your linked, I am using a new version of the lib that using the latest API of Clerk so things changed a lot from that ReadMe

Oh the part your linked, I am using a new version of the lib that using the latest API of Clerk so things changed a lot from that ReadMe

View file

@ -1,5 +1,6 @@
<script lang="ts">
import { messages } from '$lib/i18n';
import SignOutButton from 'clerk-sveltekit/client/SignOutButton.svelte';
let { title, username }: { title: string; username: string } = $props();
@ -10,6 +11,7 @@
<h2 class="prose prose-xl">Hestia</h2>
<h1 class="prose prose-2xl">{title}</h1>
<p class="prose prose-lg">{message}</p>
<SignOutButton />
</header>
<style>

View file

@ -1,22 +1,55 @@
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
import { redirect, type ServerLoadEvent } from '@sveltejs/kit';
import dayjs from 'dayjs';
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
import { prisma } from '../prisma';
import { createClerkClient } from '@clerk/backend';
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
import { CLERK_SECRET_KEY } from '$env/static/private';
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
import { clerkClient } from 'clerk-sveltekit/server';
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
import { logger } from '$lib/server/logger';
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
export async function validateSession(event: ServerLoadEvent) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
const sessionId = event.cookies.get('auth_session');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
if (!sessionId) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
redirect(302, '/login');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
const clerkSessionClient = createClerkClient({
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
secretKey: CLERK_SECRET_KEY,
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
});
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
export async function validateSession({ locals }: ServerLoadEvent) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
if (!locals.auth.userId || !locals.auth.sessionId) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
return redirect(307, '/login');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
}
const session = await prisma.session.findUnique({
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
where: { id: sessionId },
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
include: { user: true },
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
if (!locals.auth.orgId && locals.auth.sessionId) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
// Sign out the user if they are not associated with an organization
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
await clerkSessionClient.sessions.revokeSession(locals.auth.sessionId);
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
return redirect(307, '/login');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
}
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
const clerkUser = await clerkClient.users.getUser(locals.auth.userId);
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
let user = await prisma.user.findFirst({
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
where: {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
clerkId: clerkUser.id,
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
},
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
});
if (!session || !session.user) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
redirect(302, '/login');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
if (!user) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
if (clerkUser.emailAddresses.length === 0) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
logger.error('User has no email address');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
await clerkSessionClient.sessions.revokeSession(locals.auth.sessionId);
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
return redirect(307, '/login');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
}
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
user = await prisma.user.create({
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
data: {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
clerkId: clerkUser.id,
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
email: clerkUser.emailAddresses[0].emailAddress,
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
name: clerkUser.fullName ?? '',
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
},
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
});
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
if (clerkUser.fullName === null) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
logger.error('User has no name');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
}
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
}
const expiry = session.expiresAt;
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
if (dayjs(expiry).isBefore(dayjs())) {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
redirect(302, '/login');
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
}
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
return session;
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
return {
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
user: { name: user.name },
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
};
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
}

BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema
BenjaminPalko commented 2025-01-02 13:52:59 -05:00 (Migrated from github.com)
Review

???

???
piopi commented 2025-01-02 13:57:40 -05:00 (Migrated from github.com)
Review

don't like that 😉 ?

don't like that 😉 ?
BenjaminPalko commented 2025-01-02 16:25:24 -05:00 (Migrated from github.com)
Review

Why are we using clerk/express?

Why are we using clerk/express?
piopi commented 2025-01-02 20:04:05 -05:00 (Migrated from github.com)
Review

Because clerk is deprecating the nodejs package and is recommending to use this one for backend

Because clerk is deprecating the nodejs package and is recommending to use this one for backend
BenjaminPalko commented 2025-01-02 20:04:47 -05:00 (Migrated from github.com)
Review

WE ARE PROFESSIONALS HERE MOE

WE ARE PROFESSIONALS HERE MOE
piopi commented 2025-01-02 20:09:50 -05:00 (Migrated from github.com)
Review

I will change it to an empty string, I thought we were fun professionals

I will change it to an empty string, I thought we were fun professionals
BenjaminPalko commented 2025-01-02 21:03:38 -05:00 (Migrated from github.com)
Review

is the user fullName optional...? I'd rather not default to a magic string

is the user fullName optional...? I'd rather not default to a magic string
BenjaminPalko commented 2025-01-02 21:04:40 -05:00 (Migrated from github.com)
Review

If there is a situation where name will be empty/undefined consider changing the db schema

If there is a situation where name will be empty/undefined consider changing the db schema

View file

@ -1,31 +0,0 @@
import { Lucia } from 'lucia';
import { PrismaAdapter } from '@lucia-auth/adapter-prisma';
import { prisma } from '$lib/server/prisma';
const adapter = new PrismaAdapter(prisma.session, prisma.user);
// expect error (see next section)
export const auth = new Lucia(adapter, {
sessionCookie: {
attributes: {
secure: process.env.NODE_ENV === 'production',
},
},
getUserAttributes: (attributes) => {
return {
email: attributes.email,
};
},
});
declare module 'lucia' {
interface Register {
Lucia: typeof Lucia;
DatabaseUserAttributes: DatabaseUserAttributes;
}
}
interface DatabaseUserAttributes {
email: string;
}
export type Auth = typeof auth;

View file

@ -1,12 +1,17 @@
<script lang="ts">
import ClerkProvider from 'clerk-sveltekit/client/ClerkProvider.svelte';
import { i18n } from '$lib/i18n';
import { ParaglideJS } from '@inlang/paraglide-sveltekit';
import '../app.css';
import { PUBLIC_CLERK_PUBLISHABLE_KEY } from '$env/static/public';
let { children } = $props();
</script>
<div class="layout">
{@render children()}
<ClerkProvider publishableKey={PUBLIC_CLERK_PUBLISHABLE_KEY}>
{@render children()}
</ClerkProvider>
</div>
<ParaglideJS {i18n}>

View file

@ -1,5 +1,3 @@
import { validateSession } from '$lib/server/auth';
export async function load(event) {
await validateSession(event);
}
export const load = async (event) => validateSession(event);

View file

@ -1,10 +1,3 @@
import { validateSession } from '$lib/server/auth';
export async function load(event) {
const {
user: { password: _, ...rest },
} = await validateSession(event);
return {
user: rest,
};
}
export const load = async (event) => validateSession(event);

View file

@ -2,6 +2,8 @@
import { Navbar } from '$lib/components/Navigation';
import type { User } from '@prisma/client';
import type { Snippet } from 'svelte';
import { onMount } from 'svelte';
import 'clerk-sveltekit/client';
type Props = {
children: Snippet;
@ -11,6 +13,35 @@
};
let { children, data }: Props = $props();
let clerk;
onMount(async () => {
clerk = window.Clerk;
if (clerk) {
if (!clerk.user || clerk.user?.organizationMemberships.length === 0) {
console.debug('No organizations found');
await clerk.signOut();
return;
}
BenjaminPalko commented 2025-01-02 14:03:24 -05:00 (Migrated from github.com)
Review

Can you explain what this is doing?

Can you explain what this is doing?
piopi commented 2025-01-02 20:05:44 -05:00 (Migrated from github.com)
Review

I will add some comment, it is automatically selecting the first organization that the user is part of, if you don't do that the user get login without an organization

I will add some comment, it is automatically selecting the first organization that the user is part of, if you don't do that the user get login without an organization
BenjaminPalko commented 2025-01-03 10:57:36 -05:00 (Migrated from github.com)
Review

It would be better to do this check on the server to prevent anything from being leaked to the client side, you can use +layout.server.ts. We could throw an error, 403 - User does not belong to a Tenant

It would be better to do this check on the server to prevent anything from being leaked to the client side, you can use `+layout.server.ts`. We could throw an error, `403 - User does not belong to a Tenant`
piopi commented 2025-01-03 10:59:11 -05:00 (Migrated from github.com)
Review

I am already logging out the user on the backend, this is only selecting an org for him

I am already logging out the user on the backend, this is only selecting an org for him
BenjaminPalko commented 2025-01-03 10:59:12 -05:00 (Migrated from github.com)
Review

Also, modify the error page to contain a signout button, perhaps under certain http codes (like 403)

Also, modify the error page to contain a signout button, perhaps under certain http codes (like 403)
/**
* Set the active organization to the first one in the list, this is temporary until we let the user choose the organization
*/
try {
// Set the active organization to the first one in the list
await clerk.setActive({
organization: clerk.user?.organizationMemberships[0].organization.id,
});
console.debug(
`Active organization set to ${clerk.user?.organizationMemberships[0].organization.id}`
);
} catch (error) {
console.error('Error setting active organization:', error);
}
}
});
</script>
<Navbar title="Svelte" username={data.user.name} />

View file

@ -1,96 +0,0 @@
import { messages } from '$lib/i18n';
import { logger } from '$lib/server/logger';
import { auth } from '$lib/server/lucia.js';
import { prisma } from '$lib/server/prisma';
import { fail, redirect, type Actions } from '@sveltejs/kit';
import { Argon2id } from 'oslo/password';
import { string } from 'zod';
export const actions = {
login: async (event) => {
const form = await event.request.formData();
const email = form.get('email');
if (typeof email !== 'string') {
return fail(400, { email: { error: messages.login_error_email_required() } });
}
const password = form.get('password') as string;
if (!password) {
return fail(400, { password: { error: messages.login_error_password_required() } });
}
const user = await prisma.user.findUnique({
where: {
email: email,
},
});
if (!user) {
logger.error(`User not found! ${email}`);
return fail(404, {
email: { value: email, error: messages.login_error_user_not_found() },
});
}
const validPassword = await new Argon2id().verify(user.password, password);
if (!validPassword) {
return fail(400, {
password: { error: messages.login_error_password_incorrect() },
});
}
const session = await auth.createSession(user.id, []);
const sessionCookie = auth.createSessionCookie(session.id);
event.cookies.set(sessionCookie.name, sessionCookie.value, {
path: '/',
maxAge: 120,
});
redirect(302, '/');
},
register: async (event) => {
const form = await event.request.formData();
if (!form.has('email')) {
return fail(400, { email: { error: messages.login_error_email_required() } });
}
const { success, data: email, error } = string().email().safeParse(form.get('email'));
if (!success) {
logger.error(error);
return fail(400, {
email: { value: email, error: messages.login_error_email_incorrect() },
});
}
const password = form.get('password');
if (typeof password !== 'string') {
return fail(400, { password: { error: messages.login_error_password_required() } });
}
const name = form.get('name');
if (typeof name !== 'string') {
return fail(400, { name: { error: messages.login_error_name_required() } });
}
const usersWithEmail = await prisma.user.count({ where: { email: email } });
if (usersWithEmail !== 0) {
return fail(409, {
email: { value: email, error: messages.login_error_email_inuse() },
});
}
const hashedPassword = await new Argon2id().hash(password);
const user = await prisma.user.create({
data: {
email: form.get('email') as string,
name: form.get('name') as string,
password: hashedPassword,
},
});
const session = await auth.createSession(user.id.toString(), {});
const sessionCookie = auth.createSessionCookie(session.id);
event.cookies.set(sessionCookie.name, sessionCookie.value, {
path: '/',
maxAge: 120,
});
redirect(303, '/');
},
} satisfies Actions;

View file

@ -1,77 +1,23 @@
<script lang="ts">
import { TextInput } from '$lib/components/DataInput';
import { Button } from '$lib/components/Actions';
import Tabs from '$lib/components/Navigation/Tabs';
import { messages } from '$lib/i18n/index.js';
import { fade } from 'svelte/transition';
let { form } = $props();
let tab: 0 | 1 = $state(0);
import SignIn from 'clerk-sveltekit/client/SignIn.svelte';
import { dark } from '@clerk/themes';
</script>
{#snippet userIcon()}
<i class="fi fi-br-envelope"></i>
{/snippet}
{#snippet passwordIcon()}
<i class="fi fi-br-key"></i>
{/snippet}
{#snippet nameIcon()}
<i class="fi fi-rr-user"></i>
{/snippet}
{#snippet alert(message: string)}
<div role="alert" class="alert alert-error absolute -top-20" transition:fade>
<i class="fi fi-bs-octagon-xmark h-6 w-6 shrink-0"></i>
<span>{message}</span>
</div>
{/snippet}
{#snippet Form(variant: 'login' | 'register')}
<form method="POST" action={`?/${variant}`}>
<div class="card-body gap-4">
<TextInput
start={userIcon}
placeholder={messages.login_label_email()}
name="email"
type="email"
/>
<TextInput
start={passwordIcon}
placeholder={messages.login_label_password()}
name="password"
type="password"
/>
{#if variant === 'register'}
<TextInput
start={nameIcon}
placeholder={messages.login_label_name()}
name="name"
fade
/>
{/if}
</div>
<div class="card-actions px-4">
<Button block type="submit" outline>{messages.login_button_submit()}</Button>
</div>
</form>
{/snippet}
<div class="page" transition:fade>
<div class="card bg-base-200 py-4 shadow-xl">
<div class="card-title">
{#if form}
{@render alert(Object.values(form)[0].error)}
{/if}
<Tabs
variant="bordered"
bind:selected={tab}
tabs={[messages.login_tab_login(), messages.login_tab_register()]}
/>
</div>
{@render Form(tab === 0 ? 'login' : 'register')}
<div>
<SignIn
appearance={{
baseTheme: dark,
variables: {
colorPrimary: '#FFF',
},
elements: {
// Remove the sign-up link
footerAction: { display: 'none' },
},
}}
/>
</div>
</div>