@collect_auth
def reset_password_get(auth, uid=None, token=None):
 if auth.logged_in:
  return auth_logout(redirect_url=request.url)
 user_obj = User.load(uid)
 if (not (user_obj and user_obj.verify_password_token(token=token))):
  error_data = {'message_short': 'Invalid Request.', 'message_long': 'The requested URL is invalid, has expired, or was already used'}
  raise HTTPError(http.BAD_REQUEST, data=error_data)
 user_obj.verification_key_v2 = generate_verification_key(verification_type='password')
 user_obj.save()
 return {'uid': user_obj._id, 'token': user_obj.verification_key_v2['token']}

@ collect_auth def reset_password_get ( auth , uid = None , token = None ) : if auth . logged_in : return auth_logout ( redirect_url = request . url ) user_obj = User . load ( uid ) if ( not ( user_obj and user_obj . verify_password_token ( token = token ) ) ) : error_data = { 'message_short' : 'Invalid Request.' , 'message_long' : 'The requested URL is invalid, has expired, or was already used' } raise HTTPError ( http . BAD_REQUEST , data = error_data ) user_obj . verification_key_v2 = generate_verification_key ( verification_type = 'password' ) user_obj . save ( ) return { 'uid' : user_obj . _id , 'token' : user_obj . verification_key_v2 [ 'token' ] }
view for user to land on the reset password page .