Skip to content

Commit

Permalink
Merge pull request #47 from traP-jp/feat/#22-session
Browse files Browse the repository at this point in the history
第二部 - セッション管理機構の実装
  • Loading branch information
kenken714 authored Nov 20, 2024
2 parents 67253ad + 26455b9 commit 2fc15dc
Show file tree
Hide file tree
Showing 22 changed files with 1,358 additions and 726 deletions.
2 changes: 1 addition & 1 deletion docs/chapter2/section1/0_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DB_DATABASE="world"
4. 以下のコマンドを実行し、クレートの依存関係を追加しましょう。

```sh
$ cargo add axum anyhow serde serde_json tokio bcrypt --features tokio/full,serde/derive,axum/macros
$ cargo add axum axum-extra anyhow serde serde_json tokio bcrypt --features tokio/full,serde/derive,axum/macros,axum-extra/typed-header
$ cargo add async-session tracing tracing-subscriber --features tracing-subscriber/env-filter,tracing-subscriber/fmt
$ cargo add tower-http --features add-extension,trace,fs
```
Expand Down
3 changes: 3 additions & 0 deletions docs/chapter2/section1/1_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ pub async fn sign_up(
::: code-group
<<<@/chapter2/section1/src/1_account/auth.rs{rs:line-numbers}[auth.rs]
<<<@/chapter2/section1/src/1_account/users.rs{rs:line-numbers}[users.rs]
<<<@/chapter2/section1/src/1_account/main.rs{rs:line-numbers}[main.rs]
<<<@/chapter2/section1/src/1_account/repository.rs{rs:line-numbers}[repository.rs]
:::

最後に、`handler.rs` に、先ほど書いたハンドラーを追加しましょう。
Expand Down Expand Up @@ -413,6 +415,7 @@ $ task db
```sql
mysql> USE world;
mysql> SELECT * FROM users;
mysql> SELECT * FROM user_passwords;
```
![](images/3/database1-user.png)

Expand Down
Loading

0 comments on commit 2fc15dc

Please sign in to comment.