Maybe the Forgot Password Module is something to implement to speed up your progress. This has a registration/signup functionalty and forgot password funcctionality. Of course you can build it yourself, perhaps a little more lightweight but use the examples/flows in the module to see how to set it up.
'How to access the form variables in a microflow’ → Place the fields in a dataview with a non-persistable object as its context. You can then pass that object upon signing in and read the values.
As Sjors suggested the forgot password module has a good example of how to do this. In the module there is a snippet called “LoginSnippet” that you can add to a page that is accessible to anonymous users. To enable anonymous users in your application, go to security in the project module and create a user role for anonymous uers (I usually call this anonymous), then go to the anonymous user tab and enable anonymous users.
If you want to build this page yourself, you can use the authentication widgets on a page that is accessible to anonymous users. You just need a username and password input field, and a sign in button on a page.
Hope this helps!