Page MenuHomePhabricator

[Cashtab] Adjust useWebAuthentication to soft fail when visiting from a non https:// source
AbandonedPublic

Authored by emack on Dec 1 2021, 12:25.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary
  • Updates useWebAuthentication.js to check whether the window and window.PublicKeyCredential objects exist before proceeding with the biometric authentication logic.
  • Without this check, the app currently crashes when loaded from a non https:// or localhost source, which isn't a problem for the end user since they're not meant to be accessing Cashtab from anything other than a secure https:// source, but we are using local LAN sources to rapidly test Cashtab on physical mobile devices without having to rebuild and redeploy onto netlify each time.

image.png (378×762 px, 206 KB)

Test Plan
  • visit cashtab dev instance from a local LAN ip and ensure no hard crashes
  • visit https://serene1148.netlify.app which is a build of this diff on an iOS or android device
  • activate biometrics in settings and setup fingerprint
  • minimise app, then reopen and confirm login successfully via fingerprint
  • deactivate biometrics in settings
  • minimise app, then reopen and confirm no requests for biometric login

Diff Detail

Repository
rABC Bitcoin ABC
Branch
biometricFix
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17487
Build 34800: Build Diffcashtab-tests
Build 34799: arc lint + arc unit

Event Timeline

emack requested review of this revision.Dec 1 2021, 12:25
emack edited the summary of this revision. (Show Details)

tested on

  • Samsung S20 FE, Android 11
    • Chrome 96.0.4664.45
    • Firefox 94.1.2
    • Edge 96.0.1054.36

Everything works as expected.

tested on

  • Ipad 5th generation, IpadOS 15.1
    • Safari
    • Chrome
    • Edge
    • Firefox

Everything works as expected.
Except on firefox

  • the Cashtab logo and eCash logo at the top not showing
  • active button shown with light grey background

tested on

  • Samsung S20 FE, Android 11
    • Chrome 96.0.4664.45
    • Firefox 94.1.2
    • Edge 96.0.1054.36

Everything works as expected.

tested on

  • Ipad 5th generation, IpadOS 15.1
    • Safari
    • Chrome
    • Edge
    • Firefox

Everything works as expected.
Except on firefox

  • the Cashtab logo and eCash logo at the top not showing
  • active button shown with light grey background

Thanks for testing this.
In terms of the light grey background issue can you share a screenshot?
I've tested this on an ipad iOS 15.1 with firefox and I can't reproduce the logo not showing issue. Did you encounter this when accessing via netlify or local LAN?

The same, on both LAN and Netlify

IMAGE 2021-12-03 06:36:09.jpg (1×960 px, 26 KB)

IMAGE 2021-12-03 06:36:30.jpg (1×960 px, 46 KB)

IMAGE 2021-12-03 06:36:42.jpg (1×960 px, 42 KB)

IMAGE 2021-12-03 06:36:52.jpg (1×960 px, 42 KB)

No longer required