@@ -12,8 +12,6 @@ use serde::Serialize;
1212use ulid:: Ulid ;
1313use url:: Url ;
1414
15- use crate :: UserAgent ;
16-
1715#[ derive( Debug , Clone , PartialEq , Eq , Serialize ) ]
1816pub struct User {
1917 pub id : Ulid ,
@@ -81,7 +79,7 @@ pub enum AuthenticationMethod {
8179pub struct UserRecoverySession {
8280 pub id : Ulid ,
8381 pub email : String ,
84- pub user_agent : UserAgent ,
82+ pub user_agent : String ,
8583 pub ip_address : Option < IpAddr > ,
8684 pub locale : String ,
8785 pub created_at : DateTime < Utc > ,
@@ -137,7 +135,7 @@ pub struct BrowserSession {
137135 pub user : User ,
138136 pub created_at : DateTime < Utc > ,
139137 pub finished_at : Option < DateTime < Utc > > ,
140- pub user_agent : Option < UserAgent > ,
138+ pub user_agent : Option < String > ,
141139 pub last_active_at : Option < DateTime < Utc > > ,
142140 pub last_active_ip : Option < IpAddr > ,
143141}
@@ -159,9 +157,9 @@ impl BrowserSession {
159157 user,
160158 created_at : now,
161159 finished_at : None ,
162- user_agent : Some ( UserAgent :: parse (
160+ user_agent : Some (
163161 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.0.0 Safari/537.36" . to_owned ( )
164- ) ) ,
162+ ) ,
165163 last_active_at : Some ( now) ,
166164 last_active_ip : None ,
167165 } )
@@ -213,7 +211,7 @@ pub struct UserRegistration {
213211 pub password : Option < UserRegistrationPassword > ,
214212 pub post_auth_action : Option < serde_json:: Value > ,
215213 pub ip_address : Option < IpAddr > ,
216- pub user_agent : Option < UserAgent > ,
214+ pub user_agent : Option < String > ,
217215 pub created_at : DateTime < Utc > ,
218216 pub completed_at : Option < DateTime < Utc > > ,
219217}
0 commit comments