def signout_(request): if request.web_input(token="").token != define.get_token()[:8]: return Response(define.errorpage(request.userid, errorcode.token), status=403) login.signout(request) raise HTTPSeeOther(location="/", headers=request.response.headers)
def signout_(request): if request.web_input(token="").token != define.get_token()[:8]: raise WeasylError('token') login.signout(request) raise HTTPSeeOther(location="/", headers=request.response.headers)
def signout_(request): if request.web_input(token="").token != define.get_token()[:8]: return Response(define.errorpage(request.userid, errorcode.token)) login.signout(request) raise HTTPSeeOther(location="/", headers=request.response.headers)
def GET(self): if api.is_api_user(): raise web.webapi.Forbidden() if web.input(token="").token != define.get_token()[:8]: return define.errorpage(self.user_id, errorcode.token) login.signout(self.user_id) raise web.seeother("/index")
def wrapper(self, *a, **kw): form = web.input(token="") if not api.is_api_user() and form.token != d.get_token(): self.user_id = 0 web.header('Content-Type', 'application/json') try: return f(self, *a, **kw) except WeasylError as e: if web.ctx.status == '200 OK': web.ctx.status = '403 Forbidden' e.render_as_json = True raise except Exception as e: # double underscore here to try to not conflict with any attributes # already set on the exception, since we don't know where it's been. e.__render_as_json = True raise
def inner(request): if not weasyl.api.is_api_user() and request.params.get('token', "") != define.get_token(): return Response(define.errorpage(request.userid, errorcode.token)) return view_callable(request)
def inner(request): if not weasyl.api.is_api_user() and request.params.get( 'token', "") != define.get_token(): return Response(define.errorpage(request.userid, errorcode.token)) return view_callable(request)