diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-22 23:25:24 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-22 23:25:24 -0400 |
| commit | 01f9f3549c76702fd56e58d44c5180fecddb4bfa (patch) | |
| tree | e7a64e70975a8b50bc442d28c17161b82c42c63a /src/invite/routes/post.rs | |
| parent | 214a9e6c1fd729fc2c49eb2a5d41b5651ff5bc61 (diff) | |
Sort out the naming of the various parts of an identity.
* A `cookie::Identity` (`IdentityCookie`) is a specialized CookieJar for working with identities.
* An `Identity` is a token/login pair.
I hope for this to be a bit more legible.
In service of this, `Login` is no longer extractable. You have to get an identity.
Diffstat (limited to 'src/invite/routes/post.rs')
| -rw-r--r-- | src/invite/routes/post.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/invite/routes/post.rs b/src/invite/routes/post.rs index 80b1c27..eb7d706 100644 --- a/src/invite/routes/post.rs +++ b/src/invite/routes/post.rs @@ -1,17 +1,19 @@ use axum::extract::{Json, State}; -use crate::{app::App, clock::RequestedAt, error::Internal, invite::Invite, login::Login}; +use crate::{ + app::App, clock::RequestedAt, error::Internal, invite::Invite, token::extract::Identity, +}; pub async fn handler( State(app): State<App>, RequestedAt(issued_at): RequestedAt, - login: Login, - // Require `{}` as the only valid request for this endpoint. + identity: Identity, _: Json<Request>, ) -> Result<Json<Invite>, Internal> { - let invite = app.invites().create(&login, &issued_at).await?; + let invite = app.invites().create(&identity.login, &issued_at).await?; Ok(Json(invite)) } +// Require `{}` as the only valid request for this endpoint. #[derive(Default, serde::Deserialize)] pub struct Request {} |
