constantadvancement / Inventory-Manager

Constant Advancement inventory management system.
0 stars 0 forks source link

Add Facial Recognition Support #12

Closed rmackin97 closed 3 years ago

rmackin97 commented 3 years ago

Brainstormed implementation....

Add the following attribute to the User model:

Upon a user's first successful login they will be prompted to enable facial recognition for future app authentications. If enabled, then enableFacialRecognition is set to true.

Maintain the following three UserDefaults variables:

Whenever the app is opened (and no user is logged in):

  1. Check the UserDefaults enabledFacialRecognition variable
  2. If true, use facial recognition and ask the server for the user corresponding to the saved UserDefaults email variable
    • If the user corresponding to the UserDefaults email variable does not have their enabledFacialRecognition set to true (on the server) then the authentication fails. Otherwise, authentication is successful.
  3. If false or nil, do NOT use facial recognition

Once logged into the app:

  1. Check UserDefaults promptFacialRecognition variable
  2. If nil, prompt the user to enable facial recognition for future app authentications
    • If nil AND the UserDefaults enabledFacialRecognition variable is true, do NOT prompt to enable facial recognition.
  3. If false, do NOT prompt to enable facial recognition
rmackin97 commented 3 years ago

Implementation end up being different from above, but it is done now.