mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 12:35:38 +01:00
Revert "Merge remote-tracking branch 'upstream/master'"
This reverts commitc4307db1b8, reversing changes made to5472f952d4.
This commit is contained in:
parent
6caff7df0e
commit
37bdf21b21
11 changed files with 486 additions and 538 deletions
|
|
@ -2,15 +2,11 @@ import { serialize } from 'cookie';
|
|||
import { checkPassword, createSecureToken } from 'lib/crypto';
|
||||
import { getAccountByUsername } from 'lib/queries';
|
||||
import { AUTH_COOKIE_NAME } from 'lib/constants';
|
||||
import { ok, unauthorized, badRequest } from 'lib/response';
|
||||
import { ok, unauthorized } from 'lib/response';
|
||||
|
||||
export default async (req, res) => {
|
||||
const { username, password } = req.body;
|
||||
|
||||
if (!username || !password) {
|
||||
return badRequest(res);
|
||||
}
|
||||
|
||||
const account = await getAccountByUsername(username);
|
||||
|
||||
if (account && (await checkPassword(password, account.password))) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export default async (req, res) => {
|
|||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const { id, start_at, end_at, unit, tz, url, event_type } = req.query;
|
||||
const { id, start_at, end_at, unit, tz, url } = req.query;
|
||||
|
||||
if (!moment.tz.zone(tz) || !unitTypes.includes(unit)) {
|
||||
return badRequest(res);
|
||||
|
|
@ -21,10 +21,7 @@ export default async (req, res) => {
|
|||
const startDate = new Date(+start_at);
|
||||
const endDate = new Date(+end_at);
|
||||
|
||||
const events = await getEventMetrics(websiteId, startDate, endDate, tz, unit, {
|
||||
url,
|
||||
event_type,
|
||||
});
|
||||
const events = await getEventMetrics(websiteId, startDate, endDate, tz, unit, { url });
|
||||
|
||||
return ok(res, events);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue