Browse Source
Updated suggestions and crates
- Addressed the suggestions
- Updated Rocket to latest rc4
Also made the needed code changes
- Updated all other crates
Pinned `openssl` and `openssl-sys`
pull/4001/head
BlackDex
2 years ago
No known key found for this signature in database
GPG Key ID: 58C80A2AA6C765E1
1 changed files with
2 additions and
2 deletions
src/api/admin.rs
@ -316,7 +316,7 @@ async fn test_smtp(data: Json<InviteData>, _token: AdminToken) -> EmptyResult {
#[ get( " /logout " ) ]
#[ get( " /logout " ) ]
fn logout ( cookies : & CookieJar < '_ > ) -> Redirect {
fn logout ( cookies : & CookieJar < '_ > ) -> Redirect {
cookies . remove ( Cookie ::build ( COOKIE_NAME , "" ) . path ( admin_path ( ) ) . finish ( ) ) ;
cookies . remove ( Cookie ::build ( COOKIE_NAME ) . path ( admin_path ( ) ) ) ;
Redirect ::to ( admin_path ( ) )
Redirect ::to ( admin_path ( ) )
}
}
@ -797,7 +797,7 @@ impl<'r> FromRequest<'r> for AdminToken {
if decode_admin ( access_token ) . is_err ( ) {
if decode_admin ( access_token ) . is_err ( ) {
// Remove admin cookie
// Remove admin cookie
cookies . remove ( Cookie ::build ( COOKIE_NAME , "" ) . path ( admin_path ( ) ) . finish ( ) ) ;
cookies . remove ( Cookie ::build ( COOKIE_NAME ) . path ( admin_path ( ) ) ) ;
error ! ( "Invalid or expired admin JWT. IP: {}." , & ip . ip ) ;
error ! ( "Invalid or expired admin JWT. IP: {}." , & ip . ip ) ;
return Outcome ::Error ( ( Status ::Unauthorized , "Session expired" ) ) ;
return Outcome ::Error ( ( Status ::Unauthorized , "Session expired" ) ) ;
}
}