Add documentation

This commit is contained in:
eraden 2023-08-17 20:27:44 +02:00
parent a50cff494b
commit 6792a71820

View File

@ -28,18 +28,28 @@
//! Arc::new(keys.decoding_key),
//! Algorithm::EdDSA,
//! redis.clone(),
//! vec![Box::new(HeaderExtractor::new())]
//! vec![
//! // Check if header "Authorization" exists and contains Bearer with encoded JWT
//! Box::new(HeaderExtractor::new()),
//! // Check if cookie "Authorization" exists and contains encoded JWT
//! Box::new(CookieExtractor::new()),
//! ]
//! );
//!
//! HttpServer::new(move || {
//! let app = App::new()
//! .app_data(factory.storage())
//! .wrap(factory.clone())
//! .app_data(Data::new(redis.clone()))
//! .service(sign_in)
//! .service(sign_out)
//! .service(session)
//! .service(root);
//! HttpServer::new(move || {
//! let factory = factory.clone();
//! App::new()
//! .app_data(factory.storage())
//! .wrap(factory)
//! .app_data(Data::new(redis.clone()))
//! .service(sign_in)
//! .service(sign_out)
//! .service(session)
//! .service(root);
//! })
//! .bind(("0.0.0.0", 8080))?
//! .run()
//! .await.unwrap();
//! }
//!
//! pub struct JwtSigningKeys {