~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/dispatch/__init__.py

Move the login machinery to the new framework.

The login page is now redirected to by the XHTML Unauthorized page, and knows
to return to the right URL when authentication succeeds. It also means that we
no longer return a 200 with login page content for a totally unrelated page...

Some of the user stuff (disabling, Tos, etc.) is now broken, and /logout moved
to /+logout.

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
    # This will either return a User object, None, or perform a redirect
218
218
    # which we will not catch here.
219
219
    if app.requireauth:
220
 
        req.user = login.login(req)
221
220
        logged_in = req.user is not None
222
221
    else:
223
 
        req.user = login.get_user_details(req)
224
222
        logged_in = True
225
223
 
 
224
    assert logged_in # XXX
 
225
 
226
226
    if logged_in:
227
227
        # Keep the user's session alive by writing to the session object.
228
228
        # req.get_session().save()