Google Auth不在Heroku上运行flask/react应用程序

2024-09-30 10:38:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在我的应用程序上实现GoogleAuth,尽管它可以在本地主机上运行,但GoogleAuth不能在Heroku上运行。当我在注册页面上点击谷歌登录时,它会说:Error 400: redirect_uri_mismatch... If you’re the app developer, make sure that these request details comply with Google policies. origin: https://astrogram-jeff.herokuapp.com,如果我在登录时这样做,它会说:Error 401: invalid_client The OAuth client was not found.在localhost上这都不是问题,但我没有办法解决这个问题。我在heroku上的配置变量上添加了ID和密钥,在JavaScript源代码和重定向URI上添加了https://astrogram-jeff.herokuapp.com,但它不起作用,OAuth Consent Screen也在生产中,所以我无法找出问题所在。谷歌信息也在.env上。任何帮助都将不胜感激。 回购协议:https://github.com/JeffersonGarcia15/Astrogram 直播:https://astrogram-jeff.herokuapp.com

有一个问题是,当您从登录注册切换时,有时按钮似乎被禁用,但刷新页面会再次启用它,但这不是真正的主要问题,主要问题是GoogleAuth无法在Heroku上工作,尽管它确实可以在本地主机上工作。这是一个Flask/PostrgreSQL/SQLAlchemy/React/Redux应用程序


Tags: httpscomclient应用程序herokuerror页面uri

热门问题