pub async fn create_session(
    tenant: &str,
    data: NewSession,
    pool: DBPool,
    mongo: MongoDatabase,
    redis: &RedisClient
) -> Result<String, Status>
Expand description

Creates a new session for a user. Given the data for a new session, checks if the database contains that user, if the password matches and, if it does, creates a new session on the non-relational database and returns its ID as a Base64 encoded string that should be stored on a cookie.