INVALID_CLIENT:无效的重定向 URI Spotify 克隆错误

发布于 2025-01-14 08:44:46 字数 907 浏览 5 评论 0 原文

我在计算机上克隆这个存储库时遇到问题: https://github.com/JL978/spotify-clone-server 还有: https://github.com/JL978/spotify-clone-client

在克隆中服务器,我启动 npm 并收到“正在侦听端口:4000”消息,但是当我运行 Spotify-clone-client 时,我得到正常的界面,但是当我单击登录时按钮,我收到“INVALID_CLIENT:无效的重定向 URI”错误。我还将正确的内容放入 .env 文件中:

CLIENT_ID = (I wrote the client id on my Spotify dev dashboard here)
CLIENT_SECRET = (I revealed and wrote the client secret on my Spotify dev dashboard here)
FRONT_URI = http://localhost:3000
RE_URI = http://localhost:4000/callback
REXP = /\.localhost:3000/

此外,在 Spotify Dev 仪表板的“编辑设置”部分中,我将“http://localhost:4000/callback”添加到“重定向 URI”的文本字段中'。我没有更改源代码中的任何其他内容(如上所述),但我收到了错误。在存储库的自述文件中,没有其他需要执行的操作,还是我忽略了?

PS:我是开发新手,所以我从克隆开始。

I'm having a problem with this repository cloned on my computer:
https://github.com/JL978/spotify-clone-server
and also:
https://github.com/JL978/spotify-clone-client

In the clone server, I start the npm and a get the 'listening on port: 4000' message, but when I run the spotify-clone-client, I get the interface as normal, but when I click the log in button, I get the 'INVALID_CLIENT: Invalid redirect URI' error. I also put the correct things in the .env file:

CLIENT_ID = (I wrote the client id on my Spotify dev dashboard here)
CLIENT_SECRET = (I revealed and wrote the client secret on my Spotify dev dashboard here)
FRONT_URI = http://localhost:3000
RE_URI = http://localhost:4000/callback
REXP = /\.localhost:3000/

Also, in the Spotify Dev dashboard, in the 'Edit Settings' section, I added 'http://localhost:4000/callback' to the text field of the 'Redirect URIs'. I didn't change anything else in the source code (mentioned above), but I get the error. In the repository's README file, there's nothing else that needs to be done, or am I overlooking?

P.S: I'm new to developing, so I started off with cloning.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文