accounts icon indicating copy to clipboard operation
accounts copied to clipboard

[discuss] code authentication service

Open ozsay opened this issue 4 years ago • 4 comments

Hi,

I implemented a new authentication service which validates a previously sent code to the client.

Common use-cases:

  • login with code provided by sms
  • login with code provided by email

The service both sends the code ("prepare authentication") using a code-provider and validates it after the client logs-in.

TODO:

  • [x] implement core service
  • [x] implement twilio sms provider
  • [x] add unit tests
  • [ ] api docs ?

@davidyaha Thoughts?

ozsay avatar Aug 21 '19 11:08 ozsay

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@0470532). Click here to learn what that means. The diff coverage is 96.72%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #776   +/-   ##
========================================
  Coverage          ?   95.2%           
========================================
  Files             ?      85           
  Lines             ?    1835           
  Branches          ?     356           
========================================
  Hits              ?    1747           
  Misses            ?      80           
  Partials          ?       8
Impacted Files Coverage Δ
...ages/code/src/utils/randomstring-code-generator.ts 100% <100%> (ø)
packages/code/src/errors.ts 100% <100%> (ø)
packages/code/src/index.ts 100% <100%> (ø)
packages/code/src/utils/simple-code-hash.ts 100% <100%> (ø)
packages/code/src/accounts-code.ts 94.87% <94.87%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0470532...937f60a. Read the comment docs.

codecov[bot] avatar Aug 21 '19 15:08 codecov[bot]

@ozsay From my understanding of the pr, this service can't be used alone since it does not take care of the user account creation right?

pradel avatar Sep 24 '19 14:09 pradel

@pradel true. we use it with another service.

ozsay avatar Sep 24 '19 15:09 ozsay

I guess this should be clarified somewhere in the documentation as we want the service to be able to register a user I think.

pradel avatar Sep 24 '19 15:09 pradel