Coder Social home page Coder Social logo

Comments (6)

HenriBeck avatar HenriBeck commented on August 16, 2024

I think we can also provide better errors as there is a mapping on the native side: https://developer.apple.com/documentation/authenticationservices/asauthorizationerror/code

from dart_packages.

HenriBeck avatar HenriBeck commented on August 16, 2024

@tp After looking more at the whole error handling of the authorization, maybe it also makes sense to only support a single request per authorization on the Dart side.

My reasoning behind this: I didn't find a way of providing both Password and an Apple ID request where I wouldn't run into an error in case no password is stored.

from dart_packages.

tp avatar tp commented on August 16, 2024

My reasoning behind this: I didn't find a way of providing both Password and an Apple ID request where I wouldn't run into an error in case no password is stored.

We can definitely simplify this on the native side (to only allow requesting 1 at a time), so get more logic on the Dart side. I would still allow the consumer to request a list of authentications with a priority/order, so that the usage is very simple.

from dart_packages.

HenriBeck avatar HenriBeck commented on August 16, 2024

@tp With the improved API, I think we can close this.

from dart_packages.

tp avatar tp commented on August 16, 2024

@HenriBeck I still think it has 1 ugliness by throwing for a missing Keychain entry instead of returning null. But will verify and attempt a fix for that later. Consumers should definitely execute each login attempt in an individual try/catch.

from dart_packages.

HenriBeck avatar HenriBeck commented on August 16, 2024

@tp I think throwing an error is more appropriate here, to be honest. I would consider this a success flow, and as you said, the user should wrap each call in a try/catch.

So I think it's easier to throw an error and not have to handle the null case in the success flow (even with NNDB coming up)

from dart_packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.