pub struct RefreshToken(pub String);Expand description
A signed refresh token (JWT string).
Tuple Fields§
§0: StringImplementations§
Source§impl RefreshToken
impl RefreshToken
Sourcepub fn for_user(
user_id: Uuid,
username: &str,
is_admin: bool,
config: &JwtConfig,
) -> Result<Self, AuthError>
pub fn for_user( user_id: Uuid, username: &str, is_admin: bool, config: &JwtConfig, ) -> Result<Self, AuthError>
Sourcepub fn decode(
token: &str,
config: &JwtConfig,
) -> Result<RefreshTokenClaims, AuthError>
pub fn decode( token: &str, config: &JwtConfig, ) -> Result<RefreshTokenClaims, AuthError>
Decode and validate a refresh token.
§Errors
Returns AuthError::Jwt if the token is invalid, expired, or not a refresh token.
Auto Trait Implementations§
impl Freeze for RefreshToken
impl RefUnwindSafe for RefreshToken
impl Send for RefreshToken
impl Sync for RefreshToken
impl Unpin for RefreshToken
impl UnsafeUnpin for RefreshToken
impl UnwindSafe for RefreshToken
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more