mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Updated redis calls.
This commit is contained in:
parent
4c0beaee14
commit
f7dd0464e0
9 changed files with 44 additions and 45 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import redis from '@umami/redis-client';
|
||||
import debug from 'debug';
|
||||
import { setAuthKey } from 'lib/auth';
|
||||
import { saveAuth } from 'lib/auth';
|
||||
import { secret } from 'lib/crypto';
|
||||
import { useValidate } from 'lib/middleware';
|
||||
import { NextApiRequestQueryBody, User } from 'lib/types';
|
||||
|
|
@ -52,8 +52,8 @@ export default async (
|
|||
const user = await getUserByUsername(username, { includePassword: true });
|
||||
|
||||
if (user && checkPassword(password, user.password)) {
|
||||
if (redis) {
|
||||
const token = await setAuthKey(user);
|
||||
if (redis.enabled) {
|
||||
const token = await saveAuth({ userId: user.id });
|
||||
|
||||
return ok(res, { token, user });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue