mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 15:46:39 +08:00
fix build error
This commit is contained in:
parent
d86d5a1951
commit
0922a7fe76
@ -27,13 +27,10 @@ async function handle(
|
||||
const get_access_token = await getAccessToken();
|
||||
|
||||
if (!get_access_token.ok) {
|
||||
return NextResponse.json(
|
||||
{ error: "获取access_token失败" },
|
||||
{
|
||||
status: get_access_token.status,
|
||||
statusText: get_access_token.statusText,
|
||||
},
|
||||
);
|
||||
return NextResponse.json({ error: "获取access_token失败" }, {
|
||||
status: get_access_token.status,
|
||||
statusText: get_access_token.statusText,
|
||||
} as any);
|
||||
}
|
||||
const access_token = await get_access_token.text();
|
||||
|
||||
@ -42,3 +39,5 @@ async function handle(
|
||||
|
||||
export const GET = handle;
|
||||
// export const POST = handle;
|
||||
|
||||
export const runtime = "edge";
|
||||
|
@ -1,6 +1,7 @@
|
||||
import LoginByGithub from "./loginByGithub";
|
||||
import LoginByGoogle from "./loginByGoogle";
|
||||
import UserLoginCore from "./user-login-core";
|
||||
import { Suspense } from "react";
|
||||
|
||||
export default function LoginPage() {
|
||||
return (
|
||||
@ -14,7 +15,9 @@ export default function LoginPage() {
|
||||
{/*>*/}
|
||||
{/* */}
|
||||
{/*</Suspense>*/}
|
||||
<UserLoginCore />
|
||||
<Suspense>
|
||||
<UserLoginCore />
|
||||
</Suspense>
|
||||
</div>
|
||||
<div className="mx-auto mt-4 w-11/12 max-w-xs sm:w-full inline-flex items-center justify-center">
|
||||
{/*<Suspense*/}
|
||||
|
@ -25,8 +25,8 @@ export const authOptions: NextAuthOptions = {
|
||||
secret: process.env.NEXTAUTH_SECRET,
|
||||
providers: [
|
||||
Github({
|
||||
clientId: process.env.AUTH_GITHUB_ID as string,
|
||||
clientSecret: process.env.AUTH_GITHUB_SECRET as string,
|
||||
clientId: process.env.AUTH_GITHUB_ID ?? "",
|
||||
clientSecret: process.env.AUTH_GITHUB_SECRET ?? "",
|
||||
profile(profile) {
|
||||
return {
|
||||
id: profile.id.toString(),
|
||||
@ -129,8 +129,8 @@ export const authOptions: NextAuthOptions = {
|
||||
}
|
||||
}),
|
||||
Google({
|
||||
clientId: process.env.GOOGLE_CLIENT_ID,
|
||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
||||
clientId: process.env.GOOGLE_CLIENT_ID ?? "",
|
||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET ?? "",
|
||||
allowDangerousEmailAccountLinking: true,
|
||||
}),
|
||||
],
|
||||
|
1
lib/types/next-auth.d.ts
vendored
1
lib/types/next-auth.d.ts
vendored
@ -25,6 +25,7 @@ declare module "next-auth" {
|
||||
gh_username?: string;
|
||||
password?: string;
|
||||
isAdmin?: boolean;
|
||||
allowToLogin?: boolean;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user