I get this error when using webapp2 user authentication
Before the redirection I have access header How do I add?
Redirect code: self.redirect (Users.create_login_url (self.request.uri))
Code:
< Code> class certify (webapp2.RequestHandler): def mill (auto): user = users.get_current_user () cookie_value = self.request.cookies.get ('user') if user == cookie_value and user! = None: self.response.headers ['content type'] = 'text / plain' itself .response.write ('success') Other: self request. Title ['access-control-permission-origin'] = '*' self.redirect (users.create_login_url (self.request.uri))
DEF redirect (self, Yuri, permanent = fault, Ebert = Fell, code = none, body = none)
and
DEF redirect (Yuri, permanent = fault, abot = fault, code = none, body = none, request = none, feedback = none)
So, I think you should call the other (if You want to pass the response object):
return webapp2.redirect (users.create_login_url (self.request.uri), correct, wrong, none, none, none , Self.response)
view
No comments:
Post a Comment