def login_social(): req = request.json try: social_type = req['socialType'] token = req['token'] except: return '', HTTP_400_BAD_REQUEST error = Auth.login_social(social_type, token) if error: return jsonify(LoggedIn=False, error=error), HTTP_400_BAD_REQUEST return user.get_basic_info_with_security(current_user)
def login(): req = request.json try: email = req['email'].lower() password_hash = req['password'] except: return '', HTTP_400_BAD_REQUEST user_object = user.findSingleUser({'email': email}) error = Auth.login(user_object, password_hash) if error: return jsonify(LoggedIn=False, error=error), HTTP_400_BAD_REQUEST return user.get_basic_info_with_security(user_object)
def userBasicInfo(user_id): entry = user.findUserByID(user_id) if entry is None: return '', HTTP_404_NOT_FOUND return user.get_basic_info_with_security(entry)