diff options
Diffstat (limited to 'src/routes/login.rs')
-rw-r--r-- | src/routes/login.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/routes/login.rs b/src/routes/login.rs index 2441a21..a580873 100644 --- a/src/routes/login.rs +++ b/src/routes/login.rs @@ -60,7 +60,7 @@ impl Login { response .headers_mut() - .insert(SET_COOKIE, cookie.to_string().parse().unwrap()); + .insert(SET_COOKIE, cookie.to_string().parse()?); Ok(response) } @@ -72,7 +72,7 @@ pub struct Logout; impl Logout { #[tracing::instrument] - pub async fn get(self) -> impl IntoResponse { + pub async fn get(self) -> Result<impl IntoResponse, Error> { let cookie = Cookie::build(("token", "")) .path("/") .max_age(time::Duration::hours(-1)) @@ -84,9 +84,9 @@ impl Logout { response .headers_mut() - .insert(SET_COOKIE, cookie.to_string().parse().unwrap()); + .insert(SET_COOKIE, cookie.to_string().parse()?); - response + Ok(response) } } |