Ejemplo n.º 1
0
def sign_in(handler, user_id, password):
    is_authenticate = User.authenticate(user_id, password)

    if not is_authenticate:
        raise MSException(u'Username ou senha incorreto!', more_info={'type': 'authentication'})

    cookie.save_user_cookie(handler, user_id)
Ejemplo n.º 2
0
def sign_in(handler, user_id, password):
    is_authenticate = User.authenticate(user_id, password)

    if not is_authenticate:
        raise MSException(u'Username ou senha incorreto!',
                          more_info={'type': 'authentication'})

    cookie.save_user_cookie(handler, user_id)
Ejemplo n.º 3
0
 def post(self):
     form = json.loads(self.request.body)
     user_tdj = user_register_svc.sign_up(form)
     cookie.save_user_cookie(self, user_tdj['id'])
     self.response.out.write(json.dumps(user_tdj))