Laravel Two-Factor Rust
=======================

*v0.2.0*

Codes from an authenticator app for Laravel for Rust, with QR codes and recovery codes.

```
cargo add laravel-two-factor-rust
```

[View on crates.io](https://crates.io/crates/laravel-two-factor-rust) [View on GitHub](https://github.com/mischasigtermans/laravel-two-factor-rust)

The demo above keeps its secret in your session only, so scan it, try a code, and close the tab.

What it does
------------

- Any authenticator app

  Codes follow RFC 6238, so Google Authenticator, 1Password, Authy and every app that scans a QR code work.

- A code works once

  verify\_once lets each code through once per user, so a code someone saw over your shoulder is already spent.

- Recovery codes

  Eight codes that each log in once. A used one is replaced, so the user always has eight.

- A shared rate limit

  attempt() limits the tries per user, shared by confirming, logging in and recovering.

[View on crates.io](https://crates.io/crates/laravel-two-factor-rust).
