Function destroy_session

Source
pub fn destroy_session(
    db: &Database,
    auth: &Auth,
    item_id: i32,
) -> Result<(), (u16, &'static str)>
Expand description

/sessions/{id}

deletes the entry in the user_session with the specified item_id from db if it’s owned by the User associated with auth

§Errors

  • 404: Session not found
  • 500: Internal error
  • 500: Could not delete session

§Panics

  • could not connect to database

TODO: don’t panic if db connection fails, just return an error