use super::ClerkAuth;
#[derive(Debug, Clone, PartialEq, Eq)]
#[must_use = "a verification outcome carries the auth decision; dropping it silently skips the check"]
#[non_exhaustive]
pub enum VerificationOutcome {
Missing,
Valid(ClerkAuth),
Invalid(InvalidTokenReason),
Unavailable,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum InvalidTokenReason {
Expired,
NotYetValid,
Other,
}
impl VerificationOutcome {
#[must_use]
pub fn auth(&self) -> Option<&ClerkAuth> {
match self {
Self::Valid(auth) => Some(auth),
_ => None,
}
}
#[must_use]
pub fn into_auth(self) -> Option<ClerkAuth> {
match self {
Self::Valid(auth) => Some(auth),
_ => None,
}
}
}