mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: api redirect
This commit is contained in:
parent
d964d668dc
commit
f65a7a8724
@ -14,7 +14,7 @@ interface NezhaDataResponse {
|
|||||||
|
|
||||||
export const GET = auth(async function GET(req) {
|
export const GET = auth(async function GET(req) {
|
||||||
if (!req.auth && getEnv("SitePassword")) {
|
if (!req.auth && getEnv("SitePassword")) {
|
||||||
redirect("/api/auth/signin");
|
redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
const { searchParams } = new URL(req.url);
|
const { searchParams } = new URL(req.url);
|
||||||
|
@ -14,7 +14,7 @@ interface NezhaDataResponse {
|
|||||||
|
|
||||||
export const GET = auth(async function GET(req) {
|
export const GET = auth(async function GET(req) {
|
||||||
if (!req.auth && getEnv("SitePassword")) {
|
if (!req.auth && getEnv("SitePassword")) {
|
||||||
redirect("/api/auth/signin");
|
redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
const { searchParams } = new URL(req.url);
|
const { searchParams } = new URL(req.url);
|
||||||
|
@ -14,7 +14,7 @@ interface NezhaDataResponse {
|
|||||||
|
|
||||||
export const GET = auth(async function GET(req) {
|
export const GET = auth(async function GET(req) {
|
||||||
if (!req.auth && getEnv("SitePassword")) {
|
if (!req.auth && getEnv("SitePassword")) {
|
||||||
redirect("/api/auth/signin");
|
redirect("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = (await GetNezhaData()) as NezhaDataResponse;
|
const response = (await GetNezhaData()) as NezhaDataResponse;
|
||||||
|
Loading…
Reference in New Issue
Block a user