current_user
This commit is contained in:
@@ -40,7 +40,6 @@ def token_required(f):
|
||||
if not token:
|
||||
return jsonify({'message': 'Error - missing token'}), 403
|
||||
try:
|
||||
#data = jwt.decode(token, app.config['SECRET_KEY'], algorithm="HS256")
|
||||
data= jwt.decode(token, app.config['SECRET_KEY'], algorithms=["HS256"])
|
||||
except:
|
||||
return jsonify({'message': 'Token is invalid'}),403
|
||||
@@ -150,8 +149,8 @@ def start_resetpass():
|
||||
|
||||
@app.route("/panel/account")
|
||||
@token_required
|
||||
def account():
|
||||
return jsonify(hello="ameye world")
|
||||
def panel_account(current_user):
|
||||
return jsonify(hello=current_user)
|
||||
|
||||
@app.route("/panel/account/dash")
|
||||
@token_required
|
||||
|
||||
Reference in New Issue
Block a user