Function generate_session_wrapper

Source
pub async fn generate_session_wrapper(
    json_creds: Json<Credentials>,
    pool: Data<Pool<Postgres>>,
) -> impl Responder
Expand description

Wrapper for generate_session. Returns 202 if validated successfully and the session was generated, it will return a json representation of the generateed session. In the form

{
 "user_name": "odespo",
 "session_token": "QSoRairtJbO7XjvqwidsfkkXcYBSWEWKc0xhqf9m9wsTVvgpHowc9keItq9R5VkY1jq2RYH4mGXHEQL2O1kiBIjMq2VbzRhAouk4",
 "time_to_die": "2024-07-23T03:05:57.141340172+00:00"
}

If it fails you will get a 401 and no body content.