API 和中间件问题,无法访问 /api/auth/providers

问题描述 投票:0回答:1

我正在关注有关 Next Auth V5 的 教程

我正在尽力遵循,但我是编码初学者,我陷入困境的时间戳是 2:09:45 / 8:00:56

在中间件和登录部分,我的问题是我无法访问“localhost:3000//api/auth/providers”

//route.ts import { handlers } from "@/auth"; export const { GET, POST } = handlers;
//./auth.ts:

import NextAuth from "next-auth";
import GitHub from "next-auth/providers/github";
import Google from "next-auth/providers/google";

export const { auth, handlers, signIn, signOut } = NextAuth({
  providers: [GitHub, Google],
});
//app/api/auth/[...nextauth]/route.ts:

import { handlers } from "@/auth"
export const { GET, POST } = handlers
我没有尝试任何东西,因为我什么都不明白,哈哈

typescript next.js prisma next-auth
1个回答
0
投票
我认为网址错误。你试过吗

http://localhost:3000/api/auth/providers

© www.soinside.com 2019 - 2024. All rights reserved.