Google OAuth with Flask-Dance (always redirect to “choose account” google page)

♀尐吖头ヾ 提交于 2019-12-05 05:35:45

The blueprint generated by make_google_blueprint defaults to redirecting towards / when the authentication cycle has ended; you can configure this using the parameters redirect_url or redirect_to. In your case:

google_login = make_google_blueprint(
  client_id=app.config['GOOGLE_CLIENT_ID'],
  client_secret=app.config['GOOGLE_CLIENT_SECRET'],
  scope=['profile', 'email'],
  redirect_to='auth.auth_google_view'
)

EDIT: Also make sure your app has a good secret_key set.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!