Skip to content

🐛 Bug Report: Email OTP Login Misclassifies Flutter App as Mobile Browser #9372

Closed

Description

@mobeit00

👟 Reproduction steps

  1. Use Appwrite in a Flutter app (iOS).
  2. Call createEmailToken to generate an OTP:
    await _account.createEmailToken(
    userId: userId,
    email: email,
    );
  3. Check the received OTP email or the user’s session details in Appwrite.

👍 Expected behavior

Appwrite should correctly classify the request as originating from a mobile app, not a browser.

👎 Actual Behavior

The request is detected as: "Mobile Safari on iOS 18.2"
even though it comes from a Flutter app. This leads to misleading session information.

🎲 Appwrite version

Version 1.6.x

💻 Operating system

MacOS

🧱 Your Environment

Appwrite SDK: 14.0.0 (latest)
Appwrite Version: 1.6.1 (latest Docker version)
Platform: Flutter (iOS)

Appwrite uses Matomo’s device-detector, which does not explicitly detect Flutter apps.
Would it be possible to allow setting the client type manually in the request or improve detection?

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Activity

  1. added
    bug
    on Feb 16, 2025
  2. mobeit00 commented on Feb 16, 2025

    @mobeit00
    Author

    We have already discussed this on Discord.

    Thanks for your help! 🚀

  3. added
    product / auth
    on Feb 18, 2025
  4. stnguyen90 commented on Feb 20, 2025

    @stnguyen90
    Contributor

    Right, so we generate a user agent that looks like:

    com.example.myapp/1.0.0 iPhone17,1 iOS/18.1
    

    Matomo's device detector will parse that as:

    {
      "isBot": false,
      "clientInfo": {
        "type": "browser",
        "name": "Mobile Safari",
        "short_name": "MF",
        "version": "",
        "engine": "WebKit",
        "engine_version": "",
        "family": "Safari"
      },
      "browserFamily": "Safari",
      "isMobileOnlyBrowser": true,
      "osInfo": {
        "name": "iOS",
        "short_name": "IOS",
        "version": "18.1",
        "platform": "",
        "family": "iOS"
      },
      "osFamily": "iOS",
      "device": 10,
      "deviceName": "phablet",
      "deviceBrand": {
        "name": "Apple",
        "short_name": "AP"
      },
      "model": "iPhone 16 Pro",
      "icons": {
        "browser": "/icons/browsers/MF.png",
        "os": "/icons/os/IOS.png",
        "device": "/icons/devices/phablet.png",
        "brand": "/icons/brand/Apple.png"
      },
      "clientHints": {
        "architecture": "",
        "bitness": "",
        "mobile": false,
        "model": "",
        "platform": "",
        "platformVersion": "",
        "uaFullVersion": "",
        "fullVersionList": {}
      },
      "headers": null
    }

    Looking at their source code, I guess we need to format it with appname/bundle_id. So, if we did appname/com.example.myapp/1.0.0 iPhone17,1 iOS/18.1, it would detect it as:

    {
      "isBot": false,
      "clientInfo": {
        "type": "mobile app",
        "name": "com.example.myapp",
        "version": ""
      },
      "browserFamily": null,
      "isMobileOnlyBrowser": false,
      "osInfo": {
        "name": "iOS",
        "short_name": "IOS",
        "version": "18.1",
        "platform": "",
        "family": "iOS"
      },
      "osFamily": "iOS",
      "device": 10,
      "deviceName": "phablet",
      "deviceBrand": {
        "name": "Apple",
        "short_name": "AP"
      },
      "model": "iPhone 16 Pro",
      "icons": {
        "browser": null,
        "os": "/icons/os/IOS.png",
        "device": "/icons/devices/phablet.png",
        "brand": "/icons/brand/Apple.png"
      },
      "clientHints": {
        "architecture": "",
        "bitness": "",
        "mobile": false,
        "model": "",
        "platform": "",
        "platformVersion": "",
        "uaFullVersion": "",
        "fullVersionList": {}
      },
      "headers": null
    }
  5. HarshMN2345 commented on Sep 17, 2026

    @HarshMN2345
    Member

    Fixed in #13739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugproduct / auth

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions