Updated share token logic. Closes #1113.
This commit is contained in:
1 parent
b5de6b997e
commit
e735a1c50d
12 files changed
+44
-42
No files matched your search
@@ -2,7 +2,7 @@ import { useAuth } from 'lib/middleware';
|
||||
import { ok, methodNotAllowed, badRequest } from 'lib/response';
|
||||
import { getRealtimeData } from 'lib/queries';
|
||||
import { parseToken } from 'lib/crypto';
|
||||
import { TOKEN_HEADER } from 'lib/constants';
|
||||
import { SHARE_TOKEN_HEADER } from 'lib/constants';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
@@ -10,7 +10,7 @@ export default async (req, res) => {
|
||||
if (req.method === 'GET') {
|
||||
const { start_at } = req.query;
|
||||
|
||||
const token = req.headers[TOKEN_HEADER];
|
||||
const token = req.headers[SHARE_TOKEN_HEADER];
|
||||
|
||||
if (!token) {
|
||||
return badRequest(res);
|
||||
|
||||
Reference in new issue
Block a user