From 5b4a012f0bfb775fa0227f16af3a82a7d14d145d Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 14 Sep 2020 08:46:35 -0700 Subject: [PATCH] Fix 401 on share url. --- components/common/Calendar.module.css | 6 +++++- components/common/LanguageButton.js | 2 +- package.json | 2 +- pages/api/website/[id]/active.js | 3 --- pages/api/website/[id]/events.js | 3 --- pages/api/website/[id]/metrics.js | 3 --- pages/api/website/[id]/pageviews.js | 3 --- pages/api/website/[id]/rankings.js | 3 --- 8 files changed, 7 insertions(+), 18 deletions(-) diff --git a/components/common/Calendar.module.css b/components/common/Calendar.module.css index ee5581bd..b7e56df1 100644 --- a/components/common/Calendar.module.css +++ b/components/common/Calendar.module.css @@ -8,6 +8,7 @@ .calendar table { flex: 1; + border-spacing: 5px; } .calendar td { @@ -18,10 +19,12 @@ height: 40px; min-width: 40px; border-radius: 5px; + border: 1px solid transparent; } .calendar td:hover { - background: var(--gray100); + border: 1px solid var(--gray300); + background: var(--gray75); } .calendar td.faded { @@ -45,6 +48,7 @@ .calendar td.disabled:hover { cursor: default; background: var(--gray75); + border-color: transparent; } .calendar td.faded.disabled { diff --git a/components/common/LanguageButton.js b/components/common/LanguageButton.js index 0581a020..5565b45e 100644 --- a/components/common/LanguageButton.js +++ b/components/common/LanguageButton.js @@ -48,7 +48,7 @@ export default function LanguageButton({ menuPosition = 'bottom', menuAlign = 'l
{showMenu && ( ", "license": "MIT", diff --git a/pages/api/website/[id]/active.js b/pages/api/website/[id]/active.js index 492074a9..8c331c44 100644 --- a/pages/api/website/[id]/active.js +++ b/pages/api/website/[id]/active.js @@ -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; diff --git a/pages/api/website/[id]/events.js b/pages/api/website/[id]/events.js index 143c745a..9e3b6b51 100644 --- a/pages/api/website/[id]/events.js +++ b/pages/api/website/[id]/events.js @@ -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; diff --git a/pages/api/website/[id]/metrics.js b/pages/api/website/[id]/metrics.js index 70a9d1e6..07496b25 100644 --- a/pages/api/website/[id]/metrics.js +++ b/pages/api/website/[id]/metrics.js @@ -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; diff --git a/pages/api/website/[id]/pageviews.js b/pages/api/website/[id]/pageviews.js index 398e52e4..db5b6c33 100644 --- a/pages/api/website/[id]/pageviews.js +++ b/pages/api/website/[id]/pageviews.js @@ -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; diff --git a/pages/api/website/[id]/rankings.js b/pages/api/website/[id]/rankings.js index 158a4bc2..838aefa3 100644 --- a/pages/api/website/[id]/rankings.js +++ b/pages/api/website/[id]/rankings.js @@ -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;