diff --git a/src/modules/common.rs b/src/modules/common.rs index 35e41af..706fd30 100644 --- a/src/modules/common.rs +++ b/src/modules/common.rs @@ -1,5 +1,3 @@ -use std::net::IpAddr; - use lettre::{message::header::ContentType, Message}; use rocket::{ http::{Cookie, CookieJar}, @@ -61,7 +59,7 @@ async fn login<'a>( mut conn: DbConn, config: &State, i18n: I18n<'a>, - // _ip: VerifyEmailOrTokenGuard, + _ip: VerifyEmailOrTokenGuard, host: PrefixUri, login_req: LoginReqGuard, ) -> EmptyResult { @@ -132,8 +130,7 @@ async fn verify_token( config: &State, cookie_jar: &CookieJar<'_>, user_agent: UserAgent, - ip: IpAddr, - // ip: VerifyEmailOrTokenGuard, + ip: VerifyEmailOrTokenGuard, token_req: Json, ) -> EmptyResult { let LoginClaims { @@ -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()))?;