【问题标题】:django sanction oauth2.0 logging out userdjango sanction oauth2.0 注销用户
【发布时间】:2013-02-13 22:30:51
【问题描述】:

我正在尝试将django sanction 集成到我的博客应用程序中(此处为 django 新手),但我似乎无法在登录过程后“注销”用户(使用 Google OAuth2.0)。

整个过程似乎没有痛苦——即我能够在我的数据库上获取所有用户详细信息,并且能够访问我的 django 模板上的用户详细信息,但是,当我注销并尝试重新登录时,它似乎记得我的凭据(cookies?)。我正在尝试从here注销

p.s:我正在本地主机上开发 - 想知道这是否是问题(?)

【问题讨论】:

  • 查看您的 /o/logout/ 有什么作用?
  • 看看你的观点会很有用。
  • @GordonsBeard: /o/logout/ 回到 localhost:8000 但是当我尝试再次登录时,它显示相同的谷歌个人资料信息 - 这表明它没有让我退出。

标签: django django-views


【解决方案1】:

请看这里:How to force user logout in django?

引用:

I don't think there is a sanctioned way to do this in Django yet.

The user id is stored in the session object, but it is encoded. Unfortunately, that means you'll have to iterate through all sessions, decode and compare...

【讨论】:

  • 我很难相信 :(
猜你喜欢
  • 2021-11-23
  • 2019-01-05
  • 1970-01-01
  • 2023-04-06
  • 2023-03-27
  • 2018-08-07
  • 2016-06-17
  • 2019-08-26
相关资源
最近更新 更多