pub async fn verify_user(
tracking_label: &str,
config: &CoreConfig,
db_pool: &Pool<PostgresConnectionManager<MakeTlsConnector>>,
kafka_pool: &KafkaPublisher,
full_url: &str,
) -> Result<Response<Body>, Infallible>
Expand description
verify_user
Handles verifying a user’s email (users.email
)
record (in the users_verified
table)
based off values in the query parameters on the hyper
Request
’s url
§Overview Notes
This function only updates 1 users_verified
record at a time.
§Arguments
tracking_label
-&str
- caller logging label_config
-CoreConfig
server statics and not used in request in this versiondb_pool
-Pool
- postgres client db threadpool with required tls encryptionkafka_pool
-KafkaPublisher
for asynchronously publishing messages to the connected kafka clusterheaders
-HeaderMap
- hashmap containing headers in key-value pairsRequest
’sBody
full_url
-&str
- the url in theRequest
§Returns
§verify_user on Success Returns
The updated users
record from the db:
(ApiResUserVerify
)
hyper Response
containing a json-serialized
ApiResUserVerify
dictionary within the
Body
and a
200
HTTP status code
Ok(Response
)
§Errors
§verify_user on Failure Returns
Note: user email verification can expire over time. Any user can attempt to re-verify at any time.
All errors return as a
hyper Response
containing a json-serialized
ApiResUserVerify
dictionary with a
non-200
HTTP status code
Err(Response
)