# Path: mineid/oauth/views.py
# class Authorize(Authorize):
#     def get_request_form(self, client, data):
#         return AuthorizationRequestForm(data, client=client)
# 
#     def get_data(self, request, key='params'):
#         switch_account = request.COOKIES.get('switch_account')
# 
#         if switch_account:
#             try:
#                 data = signing.loads(switch_account)
#                 self.cache_data(request, data)
#                 return data
#             except signing.BadSignature:
#                 pass
# 
#         return super(Authorize, self).get_data(request, key=key)
# 
#     def get(self, request, *args, **kwargs):
#         response = super(Authorize, self).get(request, *args, **kwargs)
# 
#         if 'switch_account' in request.COOKIES:
#             response.delete_cookie('switch_account')
# 
#         return response


from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from provider.compat.urls import *
from provider.oauth2.views import Redirect, Capture, AccessTokenView
from .views import Authorize


urlpatterns = patterns('',
    url('^authorize/?$',
        login_required(Capture.as_view()),

# Path: mineid/oauth/views.py
# class Authorize(Authorize):
#     def get_request_form(self, client, data):
#         return AuthorizationRequestForm(data, client=client)
# 
#     def get_data(self, request, key='params'):
#         switch_account = request.COOKIES.get('switch_account')
# 
#         if switch_account:
#             try:
#                 data = signing.loads(switch_account)
#                 self.cache_data(request, data)
#                 return data
#             except signing.BadSignature:
#                 pass
# 
#         return super(Authorize, self).get_data(request, key=key)
# 
#     def get(self, request, *args, **kwargs):
#         response = super(Authorize, self).get(request, *args, **kwargs)
# 
#         if 'switch_account' in request.COOKIES:
#             response.delete_cookie('switch_account')
# 
#         return response


# Path: mineid/oauth/urls.py
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from provider.compat.urls import *
from provider.oauth2.views import Redirect, Capture, AccessTokenView
from .views import Authorize



urlpatterns = patterns('',
    url('^authorize/?$',
        login_required(Capture.as_view()),

        name='capture'),