Skip to content

Instantly share code, notes, and snippets.

View ShaharIlany's full-sized avatar
🧙
Wizard

Shahar Ilany ShaharIlany

🧙
Wizard
View GitHub Profile
@ShaharIlany
ShaharIlany / SessionStorageRedis.ts
Last active April 12, 2023 18:53
Blitz.js Auth Session Config for Redis
import { SessionConfigMethods, SessionModel } from "@blitzjs/auth"
import { loadEnvConfig } from "@next/env"
import IoRedis from "ioredis"
const notEmpty = <TValue>(value: TValue | null | undefined): value is TValue =>
!(value === null || value === undefined)
const { REDIS_HOST, REDIS_PORT, REDIS_USER, REDIS_PASSWORD } = loadEnvConfig(
process.cwd()
).combinedEnv