aboutsummaryrefslogtreecommitdiff
path: root/crates/secd/src/command/authn.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crates/secd/src/command/authn.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/secd/src/command/authn.rs b/crates/secd/src/command/authn.rs
index 5590e8c..1d3b2d5 100644
--- a/crates/secd/src/command/authn.rs
+++ b/crates/secd/src/command/authn.rs
@@ -8,8 +8,8 @@ use crate::{
},
},
util, Address, AddressType, AddressValidation, AddressValidationId, AddressValidationMethod,
- Credential, CredentialType, Identity, IdentityId, PhoneNumber, Secd, SecdError, Session,
- SessionToken, ADDRESSS_VALIDATION_CODE_SIZE, ADDRESS_VALIDATION_ALLOWS_ATTEMPTS,
+ Credential, CredentialType, Identity, PhoneNumber, Secd, SecdError, Session, SessionToken,
+ ADDRESSS_VALIDATION_CODE_SIZE, ADDRESS_VALIDATION_ALLOWS_ATTEMPTS,
ADDRESS_VALIDATION_IDENTITY_SURJECTION, EMAIL_VALIDATION_DURATION,
};
use email_address::EmailAddress;
@@ -278,4 +278,10 @@ impl Secd {
Ok(i.swap_remove(0))
}
}
+
+ pub async fn revoke_session(&self, session: &mut Session) -> Result<(), SecdError> {
+ session.revoked_at = Some(OffsetDateTime::now_utc());
+ session.write(self.store.clone()).await?;
+ Ok(())
+ }
}