Detect mobile device and redirect them to dashboard

This commit is contained in:
Carlos Quintana 2022-05-20 08:31:29 +02:00
parent e5770de329
commit a1f37f0841
No known key found for this signature in database
GPG key ID: 15E73DCC410679F8

View file

@ -22,8 +22,21 @@ def get_browser() -> Browser:
return Browser.Other
def is_mobile() -> bool:
return request.user_agent.platform in [
"android",
"blackberry",
"ipad",
"iphone",
"symbian",
]
@onboarding_bp.route("/account_activated", methods=["GET"])
def account_activated():
if is_mobile():
return redirect(url_for("dashboard.index"))
browser = get_browser()
if browser == Browser.Chrome:
extension_link = CHROME_EXTENSION_LINK