Skip to content

Commit

Permalink
Revert "fix(server): too many request"
Browse files Browse the repository at this point in the history
This reverts commit 2bb119b.
  • Loading branch information
yoyo930021 committed Apr 9, 2024
1 parent 2bb119b commit 5965500
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/modules/common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::net::IpAddr;

use lettre::{message::header::ContentType, Message};
use rocket::{
http::{Cookie, CookieJar},
Expand Down Expand Up @@ -61,7 +59,7 @@ async fn login<'a>(
mut conn: DbConn,
config: &State<AppConfig>,
i18n: I18n<'a>,
// _ip: VerifyEmailOrTokenGuard,
_ip: VerifyEmailOrTokenGuard,
host: PrefixUri,
login_req: LoginReqGuard,
) -> EmptyResult {
Expand Down Expand Up @@ -132,8 +130,7 @@ async fn verify_token(
config: &State<AppConfig>,
cookie_jar: &CookieJar<'_>,
user_agent: UserAgent,
ip: IpAddr,
// ip: VerifyEmailOrTokenGuard,
ip: VerifyEmailOrTokenGuard,
token_req: Json<TokenReq>,
) -> EmptyResult {
let LoginClaims {
Expand All @@ -152,7 +149,7 @@ async fn verify_token(
return Err(AppError::bad_request("Invalid token".to_owned()));
}

let session = UserSession::create(&mut conn, user.id.clone(), user_agent.0, ip.to_string())
let session = UserSession::create(&mut conn, user.id.clone(), user_agent.0, ip.0.to_string())
.await
.map_err(|err| AppError::internal(err.to_string()))?;

Expand Down

0 comments on commit 5965500

Please sign in to comment.