Compare commits

...

1 Commits
main ... env

Author SHA1 Message Date
45ba633271 add role display in profile 2023-05-10 17:41:51 +02:00
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,7 @@
<div class="hero-body">
<div class="container has-text-centered">
<h1>Hello {{name}}</h1>
<h1>Vous occupez le rôle de : {{roles}}</h1>
</div>
</div>
{% endblock %}

View File

@ -18,7 +18,10 @@ def profile():
if not current_user.is_authenticated:
return redirect(url_for('security.login'))
else:
return render_template('profile.html', name=current_user.email)
roles = []
for role in current_user.roles:
roles.append(role.name)
return render_template('profile.html', name=current_user.email, roles=roles)
''' @app.route('/users', endpoint='users', methods=['GET', 'POST'])
@auth_required