This is just project for implementing a Two factor Authentification Systems. TOTP and FIDO2 Protocol.
There are three parts inside the project. Frontend (SvelteKit), Backend (Actix-Web), Caddyfile (Caddy web server).
The Caddy server is just used for having an https connection with a Domain for using authentification cookies with httpOnly.
If you don't have Caddy Server install please go the the Website Start page and install it.
- Clone the entire repository.
git clone https://github.com/lescuer97/2fa_login.git
- From the root of the project. Go to the front end folder and make sure you have pnpm installed and install the dependencies for the frontend
cd front/
npm i -g pnpm
pnpm i
-
Run de backend server
-
You can run de backend server watching for files with this command:
cargo watch -x 'run --bin rust-server'
You need to have cargo-watch installed
-
You can run with the standard cargo command
cargo run
-
-
Run the caddy server
sudo caddy run
You will also need to have Node and Rust enviroments installed in your system.