Пример #1
0
Файл: auth.py Проект: rivan/w3fu
 def post(self, req):
     user = users_c.find_email(req.form.data['email'])
     if user is None or not user.check_password(req.form.data['password']):
         raise BadRequest({'error': 'user-auth'})
     resp = Redirect(router['home'].url(req))
     UserState.login(resp, user)
     raise resp
Пример #2
0
Файл: auth.py Проект: rivan/w3fu
 def post(self, req, user):
     user.set_password(req.form.data['password'])
     users_c.update_password(user)
     resp = Redirect(router['home'].url(req))
     UserState.login(resp, user)
     raise resp