pub fn decode_without_verify<ExtraClaims: DeserializeOwned>(
    token: &str,
) -> Result<HeaderAndClaims<ExtraClaims>> {
    let mut parts = token.split('.');

    let mut header = parts.next().ok_or(Error::InvalidToken)?.as_bytes();
    let mut payload = parts.next().ok_or(Error::InvalidToken)?.as_bytes();
    let _sig = parts.next().ok_or(Error::InvalidToken)?;
    if parts.next().is_some() {
        return Err(Error::InvalidToken);
    }

    let header_r = base64::read::DecoderReader::new(&mut header, url_safe_trailing_bits());
    let header: Header = serde_json::from_reader(header_r)?;

    let payload_r = base64::read::DecoderReader::new(&mut payload, url_safe_trailing_bits());
    let claims: Claims<ExtraClaims> = serde_json::from_reader(payload_r)?;

    Ok(HeaderAndClaims { header, claims })
}
/// Decode token.
///
/// No verification or validation is performed.
Decode token.
No verification or validation is performed.
Decode token . No verification or validation is performed .
pub fn decode_without_verify<ExtraClaims: DeserializeOwned>(
    token: &str,
) -> Result<HeaderAndClaims<ExtraClaims>> {
    let mut parts = token.split('.');
    let mut header = parts.next().ok_or(Error::InvalidToken)?.as_bytes();
    let mut payload = parts.next().ok_or(Error::InvalidToken)?.as_bytes();
    let _sig = parts.next().ok_or(Error::InvalidToken)?;
    if parts.next().is_some() {
        return Err(Error::InvalidToken);
    }
    let header_r = base64::read::DecoderReader::new(&mut header, url_safe_trailing_bits());
    let header: Header = serde_json::from_reader(header_r)?;
    let payload_r = base64::read::DecoderReader::new(&mut payload, url_safe_trailing_bits());
    let claims: Claims<ExtraClaims> = serde_json::from_reader(payload_r)?;
    Ok(HeaderAndClaims { header, claims })
}
pub fn decode_without_verify < ExtraClaims : DeserializeOwned > ( token : & str , ) -> Result < HeaderAndClaims < ExtraClaims > > { let mut parts = token . split ( '.' ) ; let mut header = parts . next ( ) . ok_or ( Error :: InvalidToken ) ? . as_bytes ( ) ; let mut payload = parts . next ( ) . ok_or ( Error :: InvalidToken ) ? . as_bytes ( ) ; let _sig = parts . next ( ) . ok_or ( Error :: InvalidToken ) ? ; if parts . next ( ) . is_some ( ) { return Err ( Error :: InvalidToken ) ; } let header_r = base64 :: read :: DecoderReader :: new ( & mut header , url_safe_trailing_bits ( ) ) ; let header : Header = serde_json :: from_reader ( header_r ) ? ; let payload_r = base64 :: read :: DecoderReader :: new ( & mut payload , url_safe_trailing_bits ( ) ) ; let claims : Claims < ExtraClaims > = serde_json :: from_reader ( payload_r ) ? ; Ok ( HeaderAndClaims { header , claims } ) }
Decode token.
Decode token .
token
&str
token
&str