accounts
accounts copied to clipboard
[discuss] code authentication service
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?
Codecov Report
:exclamation: No coverage uploaded for pull request base (
master@0470532
). Click here to learn what that means. The diff coverage is96.72%
.
@@ 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.
@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 true. we use it with another service.
I guess this should be clarified somewhere in the documentation as we want the service to be able to register a user I think.