Verify links
This commit is contained in:
@@ -297,6 +297,29 @@ def send_register_mail(signup_email):
|
|||||||
|
|
||||||
mail.send(msg)
|
mail.send(msg)
|
||||||
|
|
||||||
|
@app.route("/panel/auth/register/verify", methods=["POST"])
|
||||||
|
def verify_register():
|
||||||
|
#data = request.json
|
||||||
|
vrL ='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiOTgyODkyODQyODI4NTI4OSIsInVpZCI6Ijk4Mjg5Mjg0MjgyODUyODkifSwiZXhwIjoxNzM1NTA0MDE4fQ.pDQvYUr_PGZMeMO2gr-B3DRQ7AM7IjVM5vSERNTviG4'
|
||||||
|
try:
|
||||||
|
# data= jwt.decode(data.verify_link, app.config['SECRET_KEY'], algorithms=["HS256"])
|
||||||
|
data= jwt.decode(vrL, app.config['SECRET_KEY'], algorithms=["HS256"])
|
||||||
|
except:
|
||||||
|
return jsonify({'status': 'INVALID', 'message': 'Link is invalid'}),403
|
||||||
|
|
||||||
|
print(data)
|
||||||
|
user_uid = 'a4b75649-e3c5-424f-bcdb-5481e625d24b'
|
||||||
|
FIND_USER_DETAIL= "SELECT firstname,lastname,email FROM members_pending WHERE uid::text = '"+user_uid+"'"
|
||||||
|
with connection:
|
||||||
|
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||||
|
cursor.execute(FIND_USER_DETAIL)
|
||||||
|
account = cursor.fetchall()
|
||||||
|
print(account[0])
|
||||||
|
|
||||||
|
|
||||||
|
return jsonify(status="VALID", user=account[0], pending_uid=user_uid,country=[])
|
||||||
|
|
||||||
|
|
||||||
@app.route("/panel/auth/reset", methods=["POST"])
|
@app.route("/panel/auth/reset", methods=["POST"])
|
||||||
def start_resetpass():
|
def start_resetpass():
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -12,3 +12,4 @@ flasgger
|
|||||||
sqlalchemy
|
sqlalchemy
|
||||||
flask-socketio
|
flask-socketio
|
||||||
Flask-Mail
|
Flask-Mail
|
||||||
|
pycountry
|
||||||
Reference in New Issue
Block a user