def login_company(company_name, password): company_data = Database.find_one(COLLECTION, {"company_name": company_name}) if company_data is None: return False if Utils.check_hashed_password(password, company_data['password']): return True else: return False
def enter_password(): if request.method == 'POST': password = request.form["password"] user_data = Database.find_one(UserConstants.COLLECTION, {"_id": session["user_id"]}) if user_data is not None: if Utils.check_hashed_password(password, user_data['password']): return render_template('FullCalendar.html') else: return render_template( 'userLogin.html', error_message="please enter the correct password") else: return render_template( "home.html", string="something went wrong please try again")