Verify links

This commit is contained in:
CHIEFSOFT\ameye
2024-12-27 11:58:13 -05:00
parent 28bbf772e8
commit c8919c3c9f
2 changed files with 24 additions and 0 deletions
+23
View File
@@ -297,6 +297,29 @@ def send_register_mail(signup_email):
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"])
def start_resetpass():
try:
+1
View File
@@ -12,3 +12,4 @@ flasgger
sqlalchemy
flask-socketio
Flask-Mail
pycountry