1
0
mirror of https://github.com/Yubico/yubiadmin.git synced 2025-02-21 08:54:16 +01:00

Properly commit YubiAuth changes when redirecting (fixes #6).

This commit is contained in:
Dain Nilsson 2014-03-04 12:04:48 +01:00
parent fbf1e0d000
commit 70de2f37ff

View File

@ -28,6 +28,7 @@
import os import os
import requests import requests
import imp import imp
from webob import exc
from wtforms import Form from wtforms import Form
from wtforms.fields import (SelectField, TextField, BooleanField, IntegerField, from wtforms.fields import (SelectField, TextField, BooleanField, IntegerField,
PasswordField) PasswordField)
@ -375,7 +376,12 @@ class YubiAuthApp(App):
with YubiAuth() as auth: with YubiAuth() as auth:
app = YubiAuthUsers(auth) app = YubiAuthUsers(auth)
return app(request).prerendered try:
return app(request).prerendered
except (exc.HTTPOk, exc.HTTPRedirection) as e:
# Ensure auth is closed on 200-300 codes.
exception = e
raise exception
# Pulls the tab to the right: # Pulls the tab to the right:
advanced.advanced = True advanced.advanced = True