-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase_auth.py
More file actions
28 lines (24 loc) · 804 Bytes
/
firebase_auth.py
File metadata and controls
28 lines (24 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pyrebase
firebaseConfig = {
"apiKey": "AIzaSyBdJuSUO7osFFJoEXAQZEGfGjjulJl-E30",
"authDomain": "neural-network-7a356.firebaseapp.com",
"databaseURL": "https://neural-network-7a356.firebaseio.com",
"projectId": "neural-network-7a356",
"storageBucket": "neural-network-7a356.appspot.com",
"messagingSenderId": "622588999161",
"appId": "1:622588999161:web:2f1e4a1ee2fc7cc2a07928"
}
firebase=pyrebase.initialize_app(firebaseConfig)
auth=firebase.auth()
def login(email, password):
try:
login = auth.sign_in_with_email_and_password(email, password)
except:
return False
return True
def signup(email, password):
try:
user = auth.create_user_with_email_and_password(email, password)
except:
return False
return True