|
|
|
@ -21,9 +21,7 @@ def get_user(request):
@@ -21,9 +21,7 @@ def get_user(request):
|
|
|
|
|
return request.unauthenticated_userid |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@forbidden_view_config( |
|
|
|
|
renderer="superx_budget:pyramid/templates/login.jinja2", |
|
|
|
|
) |
|
|
|
|
@forbidden_view_config(renderer="superx_budget:pyramid/templates/login.jinja2") |
|
|
|
|
def forbidden_view(request): |
|
|
|
|
return {"error": False} |
|
|
|
|
|
|
|
|
@ -42,9 +40,7 @@ def login(request):
@@ -42,9 +40,7 @@ def login(request):
|
|
|
|
|
return {"error": True} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@view_config( |
|
|
|
|
context=Root, name="logout", permission="login", |
|
|
|
|
) |
|
|
|
|
@view_config(context=Root, name="logout", permission="login") |
|
|
|
|
def logout(request): |
|
|
|
|
headers = forget(request) |
|
|
|
|
return HTTPFound("/", headers=headers) |
|
|
|
@ -53,7 +49,7 @@ def logout(request):
@@ -53,7 +49,7 @@ def logout(request):
|
|
|
|
|
def includeme(config): |
|
|
|
|
settings = config.get_settings() |
|
|
|
|
authn_policy = MyAuthenticationPolicy( |
|
|
|
|
settings["auth.secret"], hashalg="sha512", |
|
|
|
|
settings["auth.secret"], hashalg="sha512" |
|
|
|
|
) |
|
|
|
|
config.set_authentication_policy(authn_policy) |
|
|
|
|
config.set_authorization_policy(ACLAuthorizationPolicy()) |
|
|
|
|