pub async fn whoami(&self, token: String) -> Result<User> {
        let token = decode::<Claims>(
            &token,
            &DecodingKey::from_secret(&self.jwt_secret),
            &Validation::default(),
        )?;
        let username = token.claims.uid;

        self.user_service.find_by_username(&username).await
    }
/// Retrieves the User Data for the provided token
Retrieves the User Data for the provided token
Retrieves the User Data for the provided token
pub async fn whoami(&self, token: String) -> Result<User> {
        let token = decode::<Claims>(
            &token,
            &DecodingKey::from_secret(&self.jwt_secret),
            &Validation::default(),
        )?;
        let username = token.claims.uid;
        self.user_service.find_by_username(&username).await
    }
pub async fn whoami ( & self , token : String ) -> Result < User > { let token = decode :: < Claims > ( & token , & DecodingKey :: from_secret ( & self . jwt_secret ) , & Validation :: default ( ) , ) ? ; let username = token . claims . uid ; self . user_service . find_by_username ( & username ) . await }
Retrieves the User Data for the provided token
Retrieves the User Data for the provided token
&self
token
String
&self
token
String