1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Put back the old version of authenticate.

(Fred, is there a reason why you're using form.id.validate()? Doesn't seem to be defined in here.

Also properly deletes the session using session.clear rather than session = None.
As session is an observable object, if it is updated to None, the session will *not* be invalided at the end of the request. Instead, you have to call clear() which will clear its members so the cookie will be updated accordingly at the end of the request.
This commit is contained in:
Alexis Metaireau 2011-07-30 01:32:55 +02:00
parent 0fc95cefb4
commit ab305ccbc6

View file

@ -18,8 +18,6 @@ def home():
def authenticate(redirect_url=None): def authenticate(redirect_url=None):
form = AuthenticationForm() form = AuthenticationForm()
if form.id.validate():
project_id = form.id.data project_id = form.id.data
redirect_url = redirect_url or url_for("list_bills", project_id=project_id) redirect_url = redirect_url or url_for("list_bills", project_id=project_id)
@ -68,7 +66,7 @@ def create_project():
@app.route("/quit") @app.route("/quit")
def quit(): def quit():
# delete the session # delete the session
session = None session.clear()
return redirect(url_for("home")) return redirect(url_for("home"))
@app.route("/<string:project_id>/invite") @app.route("/<string:project_id>/invite")