SankethBK / diaryvault

A personal diary application written in Flutter
https://play.google.com/store/apps/details?id=me.sankethbk.dairyapp
MIT License
86 stars 59 forks source link

Implement PIN based authentication - 2 #72

Closed SankethBK closed 9 months ago

SankethBK commented 11 months ago

In first part of this issue, user enables the PIN based authentication and has setup a 4 digit PIN.

In this part we need to implement the authentication screen to collect and validate PIN during login.

1. Create a new screen to collect 4 digit PIN, (something like this, keep it consistent with themes)

image

If the "PIN-based authentication" is enabled, we should redirect user to PIN login screen instead of email+password login screen. In order to check if PIN based authentication is enabled, we need to read userConfigModel from shared preferences and check its isPINLoginEnabled (similar thing is done to check if fingerprint login is enabled, check shouldActivateFingerPrint)

Create shouldredirectToPINAuthScreen in PINAuthRepository similar to shouldActivateFingerPrint.

2. Verifying PIN and login

Create verifyPIN method in PINAuthRepository, this method should read the PIN stored in flutter_secure_storage in the form of key:value pairs (key would be in the form of _PIN) If the PIN stored in secure_storage matches the PIN entered by user, we need to emit UserLoggedIn event on authSessionBloc to start a login session with given user.

msaqeeb72 commented 11 months ago

Hey @SankethBK , Can you assign this to me, I have already implemented similar feature in native android.

SankethBK commented 11 months ago

Sure @msaqeeb72 , this depends on first part of the issue. See if you can mock / hardcode the dependant functions, till first part is completed

msaqeeb72 commented 11 months ago

I will write UI and functions and tested it with mock pin.

SankethBK commented 11 months ago

Cool, that'd be great

LujainAlMansoori commented 9 months ago

Hello can I work on this as well please, I'm working on authentication part 1 and this would be an extension of it! Thank you

SankethBK commented 9 months ago

Sure @LujainAlMansoori