Mission Impossible / How to create datatypes which cannot contain invalid state

adrianimboden
22.7K views

Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

In this program, the class AuthenticationProcedure implements the logic for the following passwordless login procedure:

  1. The user goes to the login form
  2. The user enters his email address
  3. The user gets an email with a randomly generated token
  4. The user enters the received token on the login form
  5. The user is logged in

Refactor the example with your newly aqcuired knowledge.

Authentication Procedure
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content