Skip to content

Commit

Permalink
feat: handle login errors
Browse files Browse the repository at this point in the history
  • Loading branch information
migueloller committed Feb 11, 2024
1 parent bdb1643 commit 00c2d3b
Show file tree
Hide file tree
Showing 11 changed files with 342 additions and 30 deletions.
198 changes: 196 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ name = "zero2prod"

[dependencies]
actix-web = "4"
actix-web-flash-messages = { version = "0.4", features = ["cookies"] }
anyhow = "1"
argon2 = { version = "0.4", features = ["std"] }
base64 = "0.21"
Expand Down Expand Up @@ -49,7 +50,7 @@ features = [
[dependencies.reqwest]
version = "0.11"
default-features = false
features = ["json", "rustls-tls"]
features = ["json", "rustls-tls", "cookies"]

[dev-dependencies]
claims = "0.7"
Expand Down
1 change: 1 addition & 0 deletions configuration/base.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
application:
port: 8000
hmac_secret: "long-and-very-secret-random-key-needed-to-verify-message-integrity"
database:
host: "localhost"
port: 5432
Expand Down
3 changes: 3 additions & 0 deletions spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ services:
- key: APP_DATABASE__DATABASE_NAME
scope: RUN_TIME
value: ${newsletter.DATABASE}
- key: APP_APPLICATION__HMAC_SECRET
scope: RUN_TIME
value: ${HMAC_SECRET}
databases:
- engine: PG
name: newsletter
Expand Down
1 change: 1 addition & 0 deletions src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct ApplicationSettings {
pub port: u16,
pub host: String,
pub base_url: String,
pub hmac_secret: Secret<String>,
}

#[derive(serde::Deserialize, Clone)]
Expand Down
Loading

0 comments on commit 00c2d3b

Please sign in to comment.