User CRUD on backend and refactors

This commit is contained in:
2025-10-09 16:25:15 +02:00
parent 486ff6279d
commit 2f96b55205
7 changed files with 246 additions and 174 deletions

View File

@@ -4,11 +4,6 @@ import { constant } from "effect/Function";
/* NOTE I know "effect/Config" exists, but I also don't care. This works for me. */
export const Config = Schema.Struct({
CLIENT_ID: Schema.UUID,
CLIENT_SECRET: pipe(
Schema.String,
Schema.Redacted,
),
DB_PATH: pipe(
Schema.String,
Schema.optionalWith({ default: constant("db.sqlite3") }),
@@ -22,8 +17,25 @@ export const Config = Schema.Struct({
Schema.NumberFromString,
Schema.optionalWith({ default: constant(3000) }),
),
OAUTH_CLIENT_ID: Schema.String,
OAUTH_CLIENT_SECRET: pipe(
Schema.String,
Schema.Redacted,
),
OAUTH_AUTHORIZATION_ENDPOINT: Schema.String,
OAUTH_TOKEN_ENDPOINT: Schema.String,
OAUTH_USER_ID_CLAIM: pipe(
Schema.String,
Schema.optionalWith({ default: constant("sub") }),
),
OAUTH_DISPLAY_NAME_CLAIM: pipe(
Schema.String,
Schema.optionalWith({ default: constant("display_name") }),
),
OAUTH_AVATAR_URL_CLAIM: pipe(
Schema.String,
Schema.optionalWith({ default: constant("picture") }),
),
});
export type Config = typeof Config.Type;