summaryrefslogtreecommitdiff
path: root/src/test/fixtures/identity.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-29 23:29:22 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-29 23:29:22 -0400
commit66d3fcf2e22f057bacce8d97d43a13c1c5a9ad09 (patch)
tree60995943e14a6568cf2b37622ce97df121865a6d /src/test/fixtures/identity.rs
parente328d33fc7d6a0f2e3d260d8bddee3ef633318eb (diff)
Add `change password` UI + API.
The protocol here re-checks the caller's password, as a "I left myself logged in" anti-pranking check.
Diffstat (limited to 'src/test/fixtures/identity.rs')
-rw-r--r--src/test/fixtures/identity.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/test/fixtures/identity.rs b/src/test/fixtures/identity.rs
index e438f2b..ffc44c6 100644
--- a/src/test/fixtures/identity.rs
+++ b/src/test/fixtures/identity.rs
@@ -15,11 +15,15 @@ pub async fn create(app: &App, created_at: &RequestedAt) -> Identity {
logged_in(app, &credentials, created_at).await
}
-pub async fn from_cookie(app: &App, token: &IdentityCookie, issued_at: &RequestedAt) -> Identity {
- let secret = token.secret().expect("identity token has a secret");
+pub async fn from_cookie(
+ app: &App,
+ cookie: &IdentityCookie,
+ validated_at: &RequestedAt,
+) -> Identity {
+ let secret = cookie.secret().expect("identity token has a secret");
let (token, login) = app
.tokens()
- .validate(&secret, issued_at)
+ .validate(&secret, validated_at)
.await
.expect("always validates newly-issued secret");