mirror of
https://github.com/simple-login/app.git
synced 2024-11-13 07:31:12 +01:00
Detect mobile device and redirect them to dashboard
This commit is contained in:
parent
e5770de329
commit
a1f37f0841
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue