2022-07-04 15:39:12 +02:00
|
|
|
from flask import make_response, redirect, url_for, flash
|
2022-06-15 15:42:41 +02:00
|
|
|
from flask_login import current_user
|
2022-07-26 12:38:18 +02:00
|
|
|
|
2022-06-15 15:42:41 +02:00
|
|
|
from .base import internal_bp
|
|
|
|
|
|
|
|
|
|
|
|
@internal_bp.route("/integrations/proton")
|
|
|
|
def set_enable_proton_cookie():
|
|
|
|
if current_user.is_authenticated:
|
2022-07-04 15:39:12 +02:00
|
|
|
redirect_url = url_for("dashboard.setting", _anchor="connect-with-proton")
|
2022-06-15 15:42:41 +02:00
|
|
|
else:
|
|
|
|
redirect_url = url_for("auth.login")
|
|
|
|
|
|
|
|
response = make_response(redirect(redirect_url))
|
2022-07-26 12:38:18 +02:00
|
|
|
|
|
|
|
flash("You can now connect your Proton and your SimpleLogin account", "success")
|
2022-06-15 15:42:41 +02:00
|
|
|
return response
|