Skip to content

Commit

Permalink
fix: remove 111 and 222
Browse files Browse the repository at this point in the history
  • Loading branch information
zrll12 committed Aug 25, 2024
1 parent dd03bba commit 981f899
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
7 changes: 0 additions & 7 deletions src/service/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ where
.ok_or(ErrorMessage::InvalidToken)?
.to_str()
.map_err(|_| ErrorMessage::InvalidToken)?;
if token == "222" {
return Ok(AdminTokenInfo(admin::Model {
id: 22,
username: "22".to_string(),
disabled: false,
}));
}

let user = get_user_id(token).await
.ok_or(ErrorMessage::TokenNotActivated)?;
Expand Down
5 changes: 0 additions & 5 deletions src/service/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ where S: Send + Sync {
type Rejection = ErrorMessage;

async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
TOKEN_CACHE.insert("111".to_string(), Some(UserData {
uid: "111".to_string(),
username: "test".to_string(),
})).await;

let headers = &parts.headers;
let token = headers.get("token")
.ok_or(ErrorMessage::InvalidToken)?
Expand Down

0 comments on commit 981f899

Please sign in to comment.