Updated redis logic.

This commit is contained in:
Mike Cao 2025-02-10 21:07:18 -08:00
parent 39e7ceac06
commit 4d6ec631f7
9 changed files with 52 additions and 46 deletions

View file

@ -1,4 +1,4 @@
import { redisEnabled } from '@umami/redis-client';
import redis from '@/lib/redis';
import { json } from '@/lib/response';
import { parseRequest } from '@/lib/request';
import { saveAuth } from '@/lib/auth';
@ -10,7 +10,7 @@ export async function POST(request: Request) {
return error();
}
if (redisEnabled) {
if (redis.enabled) {
const token = await saveAuth({ userId: auth.user.id }, 86400);
return json({ user: auth.user, token });