diff --git a/services/web/project/__init__.py b/services/web/project/__init__.py index bff4e2b..b551119 100644 --- a/services/web/project/__init__.py +++ b/services/web/project/__init__.py @@ -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: diff --git a/services/web/requirements.txt b/services/web/requirements.txt index 6fdc3b0..2e96f08 100644 --- a/services/web/requirements.txt +++ b/services/web/requirements.txt @@ -12,3 +12,4 @@ flasgger sqlalchemy flask-socketio Flask-Mail +pycountry \ No newline at end of file