def signuppost(request):
    username = request.POST.get('name_field')
    password = request.POST.get('password')
    email = request.POST.get('email')
    config = {
        "apiKey": "",
        "authDomain": "",
        "databaseURL": "",
        "storageBucket": "",
    }
    firebase = pyrebase.initialize_app(config)
    auth = firebase.auth()
    user = auth.create_user_with_email_and_password(email, password)
    print(user)
    uid = user['localId']
    data = {"name": username, "status": "1"}
    database.child("Daily_Report").child(uid).child("details").set(data)
    #============testing code starts here==================#
    user = authe.sign_in_with_email_and_password(email, password)
    uid = user['localId']
    request.session['fav_color'] = str(uid)
    #all_users = database.child("Daily_Report").child(uid).child("details").get()
    #d = all_users.val()
    #print ("date here is:"+str(d))
    #d = " "+str(d['name'])
    global name
    name = "<b>" + str("Hello," + str(username)) + "</b>"
    message = "Account Created Successfully"
    return render(request, 'home.html', {'name': name, 'message': message})
コード例 #2
0
ファイル: views.py プロジェクト: DevThakur07/EmployeeReport
def signuppost(request):
    username = request.POST.get('name_field')
    password = request.POST.get('password')
    email = request.POST.get('email')
    config = {
        "apiKey": "AIzaSyAdR6alwyjTM9ptvbqb_z36yDz5A6Hb78k",
        "authDomain": "employeereport-e2437.firebaseapp.com",
        "databaseURL": "https://employeereport-e2437.firebaseio.com",
        "projectId": "employeereport-e2437",
        "storageBucket": "employeereport-e2437.appspot.com",
        "messagingSenderId": "292276091021",
        "appId": "1:292276091021:web:4858069da1f96cf58a4ac4",
        "measurementId": "G-SDSK9SZ33Y"
    }
    firebase = pyrebase.initialize_app(config)
    auth = firebase.auth()
    user = auth.create_user_with_email_and_password(email, password)
    print(user)
    uid = user['localId']
    data = {"name": username, "status": "1"}
    database.child("Daily_Report").child(uid).child("details").set(data)
    #============testing code starts here==================#
    user = authe.sign_in_with_email_and_password(email, password)
    uid = user['localId']
    request.session['fav_color'] = str(uid)
    #all_users = database.child("Daily_Report").child(uid).child("details").get()
    #d = all_users.val()
    #print ("date here is:"+str(d))
    #d = " "+str(d['name'])
    global name
    name = "<b>" + str("Hello," + str(username)) + "</b>"
    message = "Account Created Successfully"
    return render(request, 'home.html', {'name': name, 'message': message})
コード例 #3
0
    def signup(self):
        import pandas as pd
        from firebase import firebase

        df2 = pd.read_csv(r'C:/Users/Arshit/signup.txt', delimiter=' ')

        details = {}
        sign_up = {}

        a = df2.shape
        b = a[0]

        fn = self.lineEdit_2.text()
        ln = self.lineEdit_3.text()
        phno = self.lineEdit_4.text()
        eid = self.lineEdit_5.text()
        psswd = self.lineEdit_6.text()

        sign_up['First Name'] = fn
        sign_up['Last Name'] = ln
        sign_up['Phone NO'] = phno
        sign_up['Email ID'] = eid
        sign_up['Password'] = psswd

        details['Sign_Up'] = sign_up

        firebaseRef = firebase.FirebaseApplication(
            "https://dbms-1bbf5.firebaseio.com/.json", None)
        firebaseRef.post(
            'https://dbms-1bbf5.firebaseio.com/Details_Of_Sign_Up', details)

        df2.loc[b] = [fn, ln, phno, eid, psswd]
        df2.to_csv(r'C:/Users/Arshit/signup.txt',
                   header='First Name',
                   index=None,
                   sep=' ',
                   mode='w')

        print("Valid")
        self.pass_msg_valid()

        import pyrebase
        config = {
            'apiKey': "AIzaSyA5XX7cMnCADNmF-FePUHwKM1Uq6bxFg4E",
            'authDomain': "dbms-1bbf5.firebaseapp.com",
            'databaseURL': "https://dbms-1bbf5.firebaseio.com",
            'projectId': "dbms-1bbf5",
            'storageBucket': "dbms-1bbf5.appspot.com",
            'messagingSenderId': "281016098399",
            'appId': "1:281016098399:web:d49bc5ac61b876eb3045ea",
            'measurementId': "G-ENSPDHYDMQ"
        }

        firebase = pyrebase.initialize_app(config)
        auth = firebase.auth()
        user = auth.create_user_with_email_and_password(eid, psswd)
コード例 #4
0
ファイル: views.py プロジェクト: gclairec/bpmsTest
def signuppost(request):
    passw = request.POST.get('pass')
    email = request.POST.get('email')
    fullName = request.POST.get('name')
    age = request.POST.get('age')
    birthdate = request.POST.get('birthdate')
    address = request.POST.get('address')
    gender = request.POST.get('gender')
    specialization = request.POST.get('specialization')
    profID = request.POST.get('profID')
    cntact = request.POST.get('cntact')

    config = {
        'apiKey': "AIzaSyCNm1eyfviO7lxJi2N0QBQf0JXeVOqk4m0",
        'authDomain': "testapp-11158.firebaseapp.com",
        'databaseURL': "https://testapp-11158.firebaseio.com",
        'projectId': "testapp-11158",
        'storageBucket': "testapp-11158.appspot.com",
        'messagingSenderId': "714865109715"
    }
    firebase = pyrebase.initialize_app(config)
    auth = firebase.auth()
    user = auth.create_user_with_email_and_password(email, passw)
    print(user)
    auth.send_email_verification(user['idToken'])
    uid = user['localId']
    data = {
        "name": fullName,
        "email": email,
        "age": age,
        "birthdate": birthdate,
        "address": address,
        "gender": gender,
        "specialization": specialization,
        "profID": profID,
        "contactNum": cntact
    }
    database.child("user").child("doctor").child(uid).child("details").set(
        data)
    #============testing code starts here==================#
    user = authe.sign_in_with_email_and_password(email, passw)
    uid = user['localId']
    request.session['fav_color'] = str(uid)
    #all_users = database.child("Daily_Report").child(uid).child("details").get()
    #d = all_users.val()
    #print ("date here is:"+str(d))
    #d = " "+str(d['name'])
    global name
    name = "<b>" + str("Hello," + str(fullName)) + "</b>"
    message = "Account Created Successfully"
    return render(request, 'home.html', {'name': name, 'message': message})
コード例 #5
0
def login(email, senha):
    config = {
        'apiKey': "AIzaSyAQwcftJBr3l60CLrKkRS1CjbMS6gom-nI",
        'authDomain': "ouvidoria-b8505.firebaseapp.com",
        'projectId': "ouvidoria-b8505",
        "databaseURL": "https://ouvidoria-b8505-default-rtdb.firebaseio.com",
        'storageBucket': "ouvidoria-b8505.appspot.com",
        'messagingSenderId': "309174700054",
        'appId': "1:309174700054:web:1a2f22886efbdfd5050d37",
        'measurementId': "G-1QEZMQME5N"
    }

    firebase = pyrebase.initialize_app(config)
    auth = firebase.auth()

    auth.sign_in_with_email_and_password(email, senha)
コード例 #6
0
def fire(request):

    firebaseConfig = {
        "apiKey": "AIzaSyCU-h440DmkaDmqb0UEKCpZ8d1W4nzQAEU",
        "authDomain": "pythondbtest-27bd9.firebaseapp.com",
        "databaseURL":
        "https://pythondbtest-27bd9-default-rtdb.firebaseio.com",
        "projectId": "pythondbtest-27bd9",
        "storageBucket": "pythondbtest-27bd9.appspot.com",
        "messagingSenderId": "701887967894",
        "appId": "1:701887967894:web:32c2d6cac25ebbecef48b7",
        "measurementId": "G-NZJ4SRZ9BV"
    }
    firebase = pyrebase.initialize_app(firebaseConfig)
    auth = firebase.auth()
    print('login...')
    # email = input("PLease Enter the Your Email Address: \n")
    # password = getpass("please Your passowrd: \n")
    try:
        email = request.POST["textq"]
        password = request.POST["passa"]
        login = auth.sign_in_with_email_and_password(email, password)
        print("succesfully loggin")
        auth.get_account_info(login['idToken'])
        a = auth.current_user['localId']
        user = authenticate(request, username=email, password=password)
        if user is not None:
            login(request, user)
            print("login")

        else:
            print("bye")

        # Return an 'invalid login' error message.

        context = {
            'filenames': login,
        }
        return render(request, 'result.html')

    except:

        print("invalid email password")
        return render(request, 'firebase.html')
コード例 #7
0
def check_for_sir(sentence):
    if 'sir' in sentence:

        import pyrebase

        config = {
        "apiKey": "AIzaSyBbxqnz3BZ5j5pfD7c4hOVBSrAfr3ziT78",
        "authDomain": "nvidiahack-d0e6d.firebaseapp.com",
        "databaseURL": "https://nvidiahack-d0e6d.firebaseio.com",
        "storageBucket": "nvidiahack-d0e6d.appspot.com",
        "serviceAccount": "/home/swap/s2s/nvidiaHack-52580fff8e27.json"
        }

        firebase = pyrebase.initialize_app(config)
        auth = firebase.auth()

        db=firebase.database()
        user = auth.sign_in_with_email_and_password("*****@*****.**", "nvidia")
        
        sir_data = db.child("sir_presence").get(user['idToken']).val()
        return(sir_data)
コード例 #8
0
def func_cadastrar_restaurante(email, senha):
    config = {
        'apiKey': "AIzaSyAQwcftJBr3l60CLrKkRS1CjbMS6gom-nI",
        'authDomain': "ouvidoria-b8505.firebaseapp.com",
        'projectId': "ouvidoria-b8505",
        "databaseURL": "https://ouvidoria-b8505-default-rtdb.firebaseio.com",
        'storageBucket': "ouvidoria-b8505.appspot.com",
        'messagingSenderId': "309174700054",
        'appId': "1:309174700054:web:1a2f22886efbdfd5050d37",
        'measurementId': "G-1QEZMQME5N"
    }
    firebase = pyrebase.initialize_app(config)
    database = firebase.database()
    auth = firebase.auth()
    user = auth.create_user_with_email_and_password(email, senha)
    user_uid = user['localId']
    database.child("Users/DadosGeograficos/" + user_uid).set({
        'userId': user_uid,
        'Email': email,
        'Senha': senha,
    })
コード例 #9
0
from django.contrib import auth
from django.urls import reverse

Config = {
    'apiKey': "AIzaSyCwt1tJItYRoKDo5omL6dVNF0gqEWhncPU",
    'authDomain': "loginformdjango.firebaseapp.com",
    'databaseURL': "https://loginformdjango.firebaseio.com",
    'projectId': "loginformdjango",
    'storageBucket': "loginformdjango.appspot.com",
    'messagingSenderId': "798266349598",
    'appId': "1:798266349598:web:c4eed81998add0f9b8b60f",
    'measurementId': "G-7218SJKRHX"
}

firebase = Firebase(Config)
auth = firebase.auth()
databse = firebase.database()


def login(request):
    return render(request, template_name="login.html")


def postlogin(request):
    username = request.POST.get('username')
    password = request.POST.get('password')
    try:
        user = auth.sign_in_with_username_and_password(username, password)
    except:
        message = "Oops! Wrong Credentials. Try Again!"
        return render(request, "login.html", {'message': message})
コード例 #10
0
ファイル: views.py プロジェクト: DevThakur07/EmployeeReport
admin_uid = "ub3F7bn3iNWkHJHHZTq0BlGFOeB2"
name = "Harish Thakur"
email = "*****@*****.**"
config = {
    "apiKey": "AIzaSyAdR6alwyjTM9ptvbqb_z36yDz5A6Hb78k",
    "authDomain": "employeereport-e2437.firebaseapp.com",
    "databaseURL": "https://employeereport-e2437.firebaseio.com",
    "projectId": "employeereport-e2437",
    "storageBucket": "employeereport-e2437.appspot.com",
    "messagingSenderId": "292276091021",
    "appId": "1:292276091021:web:4858069da1f96cf58a4ac4",
    "measurementId": "G-SDSK9SZ33Y"
}
firebase = pyrebase.initialize_app(config)
authe = firebase.auth()
database = firebase.database()


def main(request):
    return render(request, 'form.html')


def mainpost(request):
    global email
    email = request.POST.get('email')
    email = str(email).rstrip(' \t\r\n\0')  #new line added here --------
    password = request.POST.get('password')
    try:
        user = authe.sign_in_with_email_and_password(email, password)
コード例 #11
0
def Register(request):  ## signuppost
    famName = request.POST.get('famName')
    firstName = request.POST.get('firstName')
    gender = request.POST.get("gender")
    birthdate = request.POST.get("birthdate")
    email = request.POST.get('email')
    passw = request.POST.get('password')
    conf_pass = request.POST.get('conf_password')
    address = request.POST.get("address")
    num = '+63' + str(request.POST.get("mobileNum"))
    MS = request.POST.getlist('MS')
    lNum = request.POST.get("lNum")
    fullname = {'lastName': famName, 'firstname': firstName}
    ###Firebase init
    ### somewhat needed kay mu email address already registered siya if wala
    config = {
        'apiKey': "AIzaSyCwy2DSVWgniTi2PRbHlDKvF58dzE5LhmY",
        'authDomain': "thesisbpms-af272.firebaseapp.com",
        'databaseURL': "https://thesisbpms-af272.firebaseio.com",
        'projectId': "thesisbpms-af272",
        'storageBucket': "thesisbpms-af272.appspot.com",
        'messagingSenderId': "789763107091"
    }
    firebase = pyrebase.initialize_app(config)
    auth = firebase.auth()
    ### validation of password
    if (passw != conf_pass):
        ErrorMsg = "Passwords do not match"
        return render(request, "register.html", {'m': ErrorMsg})


### verification of licenseNum
    checklicnum = db.child("users").child("doctor").shallow().get().val()
    if checklicnum is None:
        try:
            user = auth.create_user_with_email_and_password(email, passw)
        except:
            ErrorMsg = "Email Address Already Registered"
            return render(request, "register.html", {'m': ErrorMsg})
        print(user)
        uid = user['localId']
        tok = user['idToken']
        users_ref = db.child("users").child("doctor").child(uid)
        sendemail = auth.send_email_verification(tok)
        users_ref.set({
            'email': email,
            'fullname': fullname,
            'address': address,
            'gender': gender,
            'contactNo': num,
            'birthDate': birthdate,
            'medicalSpecialization': MS,
            'LicenseNum': lNum,
            'status': "1",
        })

        SuccessMsg = "Account Created Successfully"
        HttpResponse(SuccessMsg)
        return render(request, "verify.html", {"e": email, 'm': SuccessMsg})
    else:
        lis = []
        for x in checklicnum:
            j = db.child("users").child("doctor").child(x).child(
                "LicenseNum").get().val()
            if j == lNum:
                ErrorMsg = "Duplicate License Number!"
                return render(request, "register.html", {'m': ErrorMsg})
        try:
            user = auth.create_user_with_email_and_password(email, passw)
        except:
            ErrorMsg = "Email Address Already Registered"
            return render(request, "register.html", {'m': ErrorMsg})
        print(user)
        uid = user['localId']
        tok = user['idToken']
        users_ref = db.child("users").child("doctor").child(uid)
        sendemail = auth.send_email_verification(tok)
        users_ref.set({
            'email': email,
            'fullname': fullname,
            'address': address,
            'gender': gender,
            'contactNo': num,
            'birthDate': birthdate,
            'medicalSpecialization': MS,
            'LicenseNum': lNum,
            'status': "1",
        })

        SuccessMsg = "Account Created Successfully"
        HttpResponse(SuccessMsg)
        return render(request, "verify.html", {"e": email, 'm': SuccessMsg})
コード例 #12
0
def step1Registration():
    def submit():
        from firebase import firebase
        #connection establishment
        firebase = firebase.FirebaseApplication(
            'https://internship-4292c-default-rtdb.firebaseio.com/')

        #create object and insert Data

        name = name_data.get()
        contact = contact_data.get()
        age = age_data.get()
        phone = phone_data.get()

        data = {
            "Name": name,
            "Contact": contact,
            "Age": age,
            'Phone': phone,
            "Email": Uemail,
            "Password ": Upassword
        }
        result = firebase.post('Personal_Details', data)
        messagebox.showinfo('Success', 'Registration Completed')
        import login

    def uploadImg():
        from tkinter.filedialog import askopenfilename

        storage = firebase.storage()
        path = askopenfilename(initialdir="",
                               filetypes=(('csv file', "*.csv"), ('all files',
                                                                  '*.*')),
                               title="Choose and image")

        #insert the images

        storage.child(path).put(path)
        sub_btn['state'] = NORMAL

    import pyrebase

    #connection establishment
    firebaseConfig = {
        'apiKey': "AIzaSyBF-5wv5cyFVe2KmHPhY3fMx0ZlPvj403Y",
        'authDomain': "internship-4292c.firebaseapp.com",
        'databaseURL': 'https://internship-4292c-default-rtdb.firebaseio.com/',
        'projectId': "internship-4292c",
        'storageBucket': "internship-4292c.appspot.com",
        'messagingSenderId': "484348816343",
        'appId': "1:484348816343:web:ac5083a4b0f669451bf992",
        'measurementId': "G-0K3TYDT7PS"
    }
    #initilizing the server

    firebase = pyrebase.initialize_app(firebaseConfig)

    #create object & perform operation
    #signup
    '''auth=firebase.auth()
    email=input("Enter your emailid")
    password=input("Enter your password")
    try:
        auth.create_user_with_email_and_password(email, password)
    except:
        print("Somethig went wronge")'''

    #Login
    auth = firebase.auth()
    Uemail = email_Data.get()
    Upassword = password_Data.get()
    Cpass = Cpassword_Data.get()
    if (Uemail == "" and Upassword == "" and Uemail.find("@") == -1):
        messagebox.showerror('Error', 'Please enter the valid details')
    elif (Upassword != Cpass):
        messagebox.showerror('Error', 'Password Missed Match')
    else:
        try:

            auth.create_user_with_email_and_password(Uemail, Upassword)
            messagebox.showinfo('Success', 'Successfull')

            #open step-2 Window
            firstWin.destroy()
            secondWin = Tk()
            secondWin.geometry('1250x1250')
            heading = Label(secondWin,
                            text="Fill out Details Step 2",
                            font=('Times', 20, "bold"))
            heading.place(x=550, y=20)
            name = Label(secondWin, text="Name")
            name.place(x=300, y=80)
            name_data = Entry(secondWin)
            name_data.place(x=700, y=80)

            contact = Label(secondWin, text="Contact")
            contact.place(x=300, y=100)
            contact_data = Entry(secondWin)
            contact_data.place(x=700, y=100)

            email = Label(secondWin, text="Age")
            email.place(x=300, y=130)
            age_data = Entry(secondWin)
            age_data.place(x=700, y=130)

            phone = Label(secondWin, text="Phone")
            phone.place(x=300, y=160)
            phone_data = Entry(secondWin)
            phone_data.place(x=700, y=160)
            upload_btn = Button(secondWin, text="Upload", command=uploadImg)
            upload_btn.place(x=700, y=200)
            sub_btn = Button(secondWin, text="Submit", command=submit)
            sub_btn.place(x=1000, y=230)
            sub_btn['state'] = DISABLED
            secondWin.mainloop()
        except:
            messagebox.showerror('Error', 'Something Went Wrong')
コード例 #13
0
ファイル: cred.py プロジェクト: ishambhandari/sathi-public
    "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDhYjncqDSl+F0A\n5zmwWKVGv6tlXDcURZch+WlY1V7nCiWzdO+YCuyOA4ZnkG3fSkJz29qM6OtkIXLf\nMzwDJNjjDObKM85Cu9MazzzjcABGQfpGSHnclb6jTniiWKQGAGS8RAM37b9sDJ7j\nVd64yWHP5KhXeKfMS5OUYOoBNO3d70zi8B6VdfZEfvqSWvBt/+IdHXD520j+8Ec9\njoRQ8ZYTJ68N+iW1sPO4AeZ9IWepHS48ZkxqXx12VIt0YvbNZmiisHMSLpBznvCo\ntWi+A87yl3mVrzviZz9xFxaFRDEE75fbLVWp17QW6Vtffl7fytQVkWZ1HwnbCuy1\nzkqcRP49AgMBAAECggEAElhy+kWMx4ewVk778KE+jsQyONVpPFKvyxmonAz+JRM7\n32Ag0oDtIWAjFBH7B4ZdY13da8PXyTY5yfY7J8xbhRu7O3E9FEyCkfeVbrPiqdVc\nAFWM6cockuFjy18otr5YdMSaeHZ3Mt3SHxIRx3vI5OmpVDljeysZr6W11nRO+lYF\nkuqgU93EUV1RkkjTw+Zkj2bvxU3qLXaVzD93QuxNZnQVVXh+5oXYgIfujS6Ji5LV\nIA3nbxmMmjCMMHROpcehhckM4owT3B3EvmBMxLVZyg7rmuUrLEZn8/APmwtCFZ7d\nPBpUsKk3c7IhTNmX8MbkANJ65qc8XHoErPObsTKJMQKBgQDwVPu5+9djJIhgkmPg\nd0JsMqeOGEvKaS0tsW9Z1qSmpU8ZYMTo4Z4Kvj3XzQK7r4PQ3TofQwlbhEqMTS4B\nw950HQIhI299wjnG9dSI/ssYKG6Se822kkFyqegtMCo5retuevI/Iyw0vsWM6RDH\n/o1rT9Q4bGHZi7HaYZhZKf2qJQKBgQDwE8OHJyLNCrisl0HBcS1+d8QHY7kgUMO8\nMRjUs6s+PVRV98q1BGlWhIG1Oua0gwXcBYC14CSz34IGNR+9rVqXL8a26/0gvpww\nh8H8X08NoYzz+JxvxLv/Aa6Jlp0XYPPaJZWhT+T1nl5al8kv+PqSCH5BP15WNiKe\nxYxdhzDsOQKBgQCeQhgRfLl029XCYiPK6D2hKioT9APUojXR5QnCSwnZgvn3aDXC\ndO+xe10WAjZOiWFv5H4ln+tFjHPat+gX2XdfVsrUL5V3ZrLNRYxTOhVbLyTA6S2p\nj93xN9lgCFuF5/Ukp2lmEi9F/GnyRHd8ey98/vBsx1IYA1l2yNWdwXz80QKBgF8v\ndtafLa0eExpa3jdUKDV8RrynTT8CxphW3wF2Ou7yYf2zwSsEFL+4ybSRJedsC2aw\nx9dUhzjJ5UOQzITntoM67g6YgkP5TvPu33qwTyeYZcpVR7EIz4DLqefjT2V1izly\nrWDHzH+VytMgWyQqEy7TLzuvZDfKPu+0Y3KxpzQBAoGAXDPKCBTXn6ZQyG403YKt\nv6HcUZv8NIENFDHEyHbAvxaDCeKlE3derxFnmvxhafHVFYLjVpy5tAeQpM1jD7jJ\nOlEQG+FjXXrVbmQJ1KQt+0nXe2wwOavX9mRrqr9hbNxTBtyr+xrv9+ks3lQr155D\neQMKgPx/FEWQE7//N3itWyQ=\n-----END PRIVATE KEY-----\n",
    "client_email":
    "*****@*****.**",
    "client_id":
    "111973346925804974041",
    "auth_uri":
    "https://accounts.google.com/o/oauth2/auth",
    "token_uri":
    "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url":
    "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url":
    "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-1ac1t%40sathi-7855d.iam.gserviceaccount.com"
}

config = {
    'apiKey': "AIzaSyBmACm1iYZkQOzfSYmOlzHzS22pTdGkCFQ",
    'authDomain': "sathi-7855d.firebaseapp.com",
    'databaseURL': "https://sathi-7855d.firebaseio.com",
    'projectId': "sathi-7855d",
    'storageBucket': "sathi-7855d.appspot.com",
    'messagingSenderId': "1085368744685",
    'appId': "1:1085368744685:web:e54fd4d72e9b2e823faae4",
    'measurementId': "G-S5RDQF37XR"
}

firebase = pyrebase.initialize_app(config)

authentication = firebase.auth()

retrieveDatabase = firebase.database()
コード例 #14
0
    "apiKey":
    "AIzaSyAt3SehcP9qPDvLTgrCXeWmwWo15MzBTqA",
    "authDomain":
    "prediction-bd050.firebaseapp.com",
    "databaseURL":
    "https://prediction-bd050.firebaseio.com",
    "storageBucket":
    "prediction-bd050.appspot.com",
    "serviceAccount":
    "/Users/yz/Documents/GitHub/disobedient-electronics/prediction-0308f7f153ab.json"
}
firebase = pyrebase.initialize_app(config)

# authenticate a user
# authUser = firebase.auth()
user = firebase.auth().sign_in_with_email_and_password("*****@*****.**",
                                                       "eadesigner")
db = firebase.database()

app = Flask(__name__)

# enable later
ser = serial.Serial('/dev/tty.usbmodem14511', 9600)


def auth(customer_id, api_key):
    try:
        credentials = {
            'customer_id': 3784,
            'api_key': '1sj1hkm5pooqou5ha8u8iju1vd'
        }
        response = requests.post('https://api.applymagicsauce.com/auth',