Skip to content

Commit

Permalink
fix(docs): Properly link demo URL
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoniePhiline committed Nov 23, 2022
1 parent 0f7b86a commit a70d3b4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://github.com/LeoniePhiline/axum-csrf-sync-pattern"
license = "Apache-2.0"
readme = "README.md"

version = "0.1.2"
version = "0.1.3"
edition = "2021"

[badges]
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ These examples are interactive demos. Run them, then interact with them in the b
### Same-site usage

**Note:** The crate repository contains example projects for same-site and cross-site usage!
In each example directory, execute `cargo run`, then open [http://127.0.0.1:3000] in your browser.
In each example directory, execute `cargo run`, then open [http://127.0.0.1:3000](http://127.0.0.1:3000) in your browser.

Configure your session and CSRF protection layer in your backend application:

Expand Down Expand Up @@ -141,9 +141,7 @@ Receive the token and send same-site requests, using your custom header:
```javascript
const test = async () => {
// Receive CSRF token (Default response header name: 'X-CSRF-TOKEN')
const token = (await fetch("/")).headers.get(
"X-Custom-Response-Header"
);
const token = (await fetch("/")).headers.get("X-Custom-Response-Header");

// Submit data using the token
await fetch("/", {
Expand All @@ -161,12 +159,12 @@ const test = async () => {
```

For a full demo, run the [same-site example project](https://github.com/LeoniePhiline/axum-csrf-sync-pattern/tree/main/examples/same-site).
You will find the interactive demo at [http://127.0.0.1:3000];
You will find the interactive demo at [http://127.0.0.1:3000](http://127.0.0.1:3000).

### CORS-enabled usage

**Note:** The crate repository contains example projects for same-site and cross-site usage!
In each example directory, execute `cargo run`, then open [http://127.0.0.1:3000] in your browser.
In each example directory, execute `cargo run`, then open [http://127.0.0.1:3000](http://127.0.0.1:3000) in your browser.

Configure your CORS layer, session and CSRF protection layer in your backend application:

Expand Down Expand Up @@ -242,7 +240,7 @@ const test = async () => {
```

For a full demo, run the [cross-site example project](https://github.com/LeoniePhiline/axum-csrf-sync-pattern/tree/main/examples/cross-site).
You will find the interactive demo at [http://127.0.0.1:3000];
You will find the interactive demo at [http://127.0.0.1:3000](http://127.0.0.1:3000).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion examples/cross-site/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cross-site"
authors = ["LeoniePhiline <awoo@posteo.de>"]
version = "0.1.2"
version = "0.1.3"
edition = "2021"
publish = false

Expand Down
2 changes: 1 addition & 1 deletion examples/same-site/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "same-site"
authors = ["LeoniePhiline <awoo@posteo.de>"]
version = "0.1.2"
version = "0.1.3"
edition = "2021"
publish = false

Expand Down

0 comments on commit a70d3b4

Please sign in to comment.