summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial/authentication
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-11-09 17:11:16 -0500
committerChris McDonough <chrism@plope.com>2013-11-09 17:11:16 -0500
commit0dcd56c2c30863c6683c0cf442aa73dfdcd11b13 (patch)
tree0f5ad0df850b40990ef8d1bf7764d3422276a147 /docs/quick_tutorial/authentication
parentc126033112e468cdf858c7c1ad0bb29e7f57f520 (diff)
downloadpyramid-0dcd56c2c30863c6683c0cf442aa73dfdcd11b13.tar.gz
pyramid-0dcd56c2c30863c6683c0cf442aa73dfdcd11b13.tar.bz2
pyramid-0dcd56c2c30863c6683c0cf442aa73dfdcd11b13.zip
undeprecate remember/forget functions and remove remember_userid/forget_userid methods from request
Diffstat (limited to 'docs/quick_tutorial/authentication')
-rw-r--r--docs/quick_tutorial/authentication/tutorial/views.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/quick_tutorial/authentication/tutorial/views.py b/docs/quick_tutorial/authentication/tutorial/views.py
index 240a23d3e..ab46eb2dd 100644
--- a/docs/quick_tutorial/authentication/tutorial/views.py
+++ b/docs/quick_tutorial/authentication/tutorial/views.py
@@ -1,4 +1,9 @@
from pyramid.httpexceptions import HTTPFound
+from pyramid.security import (
+ remember,
+ forget,
+ )
+
from pyramid.view import (
view_config,
view_defaults
@@ -36,8 +41,9 @@ class TutorialViews:
login = request.params['login']
password = request.params['password']
if USERS.get(login) == password:
- request.remember_userid(login)
- return HTTPFound(location=came_from)
+ headers = remember(request, login)
+ return HTTPFound(location=came_from,
+ headers=headers)
message = 'Failed login'
return dict(
@@ -52,6 +58,7 @@ class TutorialViews:
@view_config(route_name='logout')
def logout(self):
request = self.request
- request.forget_userid()
+ headers = forget(request)
url = request.route_url('home')
- return HTTPFound(location=url)
+ return HTTPFound(location=url,
+ headers=headers)