diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/server.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/bin/server.rs b/src/bin/server.rs index 5af3135..7c67e4f 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs | |||
@@ -24,9 +24,24 @@ async fn main() -> std::io::Result<()> { | |||
24 | .wrap(IdentityService::new( | 24 | .wrap(IdentityService::new( |
25 | CookieIdentityPolicy::new(&private_key) | 25 | CookieIdentityPolicy::new(&private_key) |
26 | .name("user-login") | 26 | .name("user-login") |
27 | .domain("127.0.0.1") | ||
28 | .path("/") | ||
29 | .same_site(actix_web::cookie::SameSite::None) | ||
30 | .http_only(true) | ||
27 | .secure(false), | 31 | .secure(false), |
28 | )) | 32 | )) |
29 | .wrap(Cors::new().supports_credentials().finish()) | 33 | .wrap( |
34 | Cors::default() | ||
35 | .allowed_origin("http://127.0.0.1:8000") | ||
36 | .allowed_origin("http://localhost:8000") | ||
37 | .allow_any_method() | ||
38 | .allow_any_header(), | ||
39 | ) | ||
40 | .wrap( | ||
41 | middleware::DefaultHeaders::new() | ||
42 | .header("Access-Control-Allow-Credentials", "true") | ||
43 | .header("Access-Control-Expose-Headers", "set-cookie"), | ||
44 | ) | ||
30 | .wrap(middleware::Logger::default()) | 45 | .wrap(middleware::Logger::default()) |
31 | .data(pool.clone()) | 46 | .data(pool.clone()) |
32 | .service( | 47 | .service( |