mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 09:13:45 +08:00
show msg on /internal/integrations/proton (#1139)
* show msg on /internal/integrations/proton * highlight the connect with Proton section * djlint
This commit is contained in:
parent
2f9301eb97
commit
6d86e64d65
2 changed files with 16 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
import arrow
|
||||
from app.config import CONNECT_WITH_PROTON_COOKIE_NAME, URL
|
||||
from flask import make_response, redirect, url_for
|
||||
from flask import make_response, redirect, url_for, flash
|
||||
from flask_login import current_user
|
||||
from .base import internal_bp
|
||||
|
||||
|
@ -8,12 +8,13 @@ from .base import internal_bp
|
|||
@internal_bp.route("/integrations/proton")
|
||||
def set_enable_proton_cookie():
|
||||
if current_user.is_authenticated:
|
||||
redirect_url = url_for("dashboard.index")
|
||||
redirect_url = url_for("dashboard.setting", _anchor="connect-with-proton")
|
||||
else:
|
||||
redirect_url = url_for("auth.login")
|
||||
|
||||
response = make_response(redirect(redirect_url))
|
||||
if CONNECT_WITH_PROTON_COOKIE_NAME:
|
||||
flash("You can now connect your Proton and your SimpleLogin account", "success")
|
||||
response.set_cookie(
|
||||
CONNECT_WITH_PROTON_COOKIE_NAME,
|
||||
value="true",
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
font-weight: 600;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.highlighted{
|
||||
border: solid 2px #5675E2;
|
||||
}
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block default_content %}
|
||||
|
@ -219,7 +223,7 @@
|
|||
<!-- Connect with Proton -->
|
||||
{% if connect_with_proton %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card" id="connect-with-proton">
|
||||
<div class="card-body">
|
||||
<div class="card-title">Connect with Proton</div>
|
||||
{% if proton_linked_account != None %}
|
||||
|
@ -719,3 +723,11 @@
|
|||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script>
|
||||
let anchor = window.location.hash;
|
||||
$(anchor).addClass("highlighted")
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue