mirror of
https://github.com/supleed2/ELEC60013-ES-CW1.git
synced 2024-11-14 03:35:48 +00:00
Added placeholder functions to check if user is logged in
This commit is contained in:
parent
8b1ce01079
commit
c470ebf42d
|
@ -1,6 +1,5 @@
|
||||||
import json
|
import json
|
||||||
import lib.utils
|
import lib.utils
|
||||||
from random import randint
|
|
||||||
from flask import Response, Blueprint, request
|
from flask import Response, Blueprint, request
|
||||||
from firebase_admin import firestore, auth
|
from firebase_admin import firestore, auth
|
||||||
from firebase_admin._auth_utils import EmailAlreadyExistsError
|
from firebase_admin._auth_utils import EmailAlreadyExistsError
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
from flask import current_app
|
|
||||||
from flask_mail import Mail, Message
|
|
||||||
|
|
||||||
def send(subject, sender, recipients, body):
|
|
||||||
mail = Mail(current_app)
|
|
||||||
msg = Message(subject, sender=sender, recipients=recipients)
|
|
||||||
msg.body = body
|
|
||||||
mail.send(msg)
|
|
|
@ -1,7 +1,7 @@
|
||||||
from random import randint
|
from random import randint
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask_mail import Mail, Message
|
from flask_mail import Mail, Message
|
||||||
from firebase_admin import firestore
|
from firebase_admin import auth, firestore
|
||||||
|
|
||||||
def sendMail(subject, sender, recipients, body):
|
def sendMail(subject, sender, recipients, body):
|
||||||
mail = Mail(current_app)
|
mail = Mail(current_app)
|
||||||
|
@ -24,3 +24,10 @@ def sendVerificationMail(name, email, code):
|
||||||
body = '''Hey {}! Thank you for signing up for BarkFinder.
|
body = '''Hey {}! Thank you for signing up for BarkFinder.
|
||||||
In order to use our sevices, could you please verify your email address by logging in and entering this code {}'''.format(name, code)
|
In order to use our sevices, could you please verify your email address by logging in and entering this code {}'''.format(name, code)
|
||||||
sendMail(subject, sender, recipients, body)
|
sendMail(subject, sender, recipients, body)
|
||||||
|
|
||||||
|
def userLoggedInAndVerfied(token):
|
||||||
|
# Need frontend to test this
|
||||||
|
# decoded_token = auth.verify_id_token(token)
|
||||||
|
# uid = decoded_token['uid']
|
||||||
|
# isVerified = auth.get_user(uid).email_verified
|
||||||
|
return True #placeholder
|
Loading…
Reference in a new issue