mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fix 401 on share url.
This commit is contained in:
parent
38ec91c48e
commit
5b4a012f0b
8 changed files with 7 additions and 18 deletions
|
|
@ -1,10 +1,7 @@
|
|||
import { getActiveVisitors } from 'lib/queries';
|
||||
import { methodNotAllowed, ok } from 'lib/response';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { id } = req.query;
|
||||
const website_id = +id;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
import moment from 'moment-timezone';
|
||||
import { getEvents } from 'lib/queries';
|
||||
import { ok, badRequest, methodNotAllowed } from 'lib/response';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
const unitTypes = ['year', 'month', 'hour', 'day'];
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { id, start_at, end_at, unit, tz } = req.query;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
import { getMetrics } from 'lib/queries';
|
||||
import { methodNotAllowed, ok } from 'lib/response';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { id, start_at, end_at } = req.query;
|
||||
const websiteId = +id;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
import moment from 'moment-timezone';
|
||||
import { getPageviews } from 'lib/queries';
|
||||
import { ok, badRequest, methodNotAllowed } from 'lib/response';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
const unitTypes = ['year', 'month', 'hour', 'day'];
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { id, start_at, end_at, unit, tz } = req.query;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { getRankings } from 'lib/queries';
|
||||
import { ok, badRequest, methodNotAllowed } from 'lib/response';
|
||||
import { DOMAIN_REGEX } from 'lib/constants';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
const sessionColumns = ['browser', 'os', 'device', 'country'];
|
||||
const pageviewColumns = ['url', 'referrer'];
|
||||
|
|
@ -26,8 +25,6 @@ function getColumn(type) {
|
|||
}
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { id, type, start_at, end_at, domain } = req.query;
|
||||
const websiteId = +id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue