diff --git a/Cargo.lock b/Cargo.lock index 23dbd00..6b489f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,6 +25,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "actix-cors" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b340e9cfa5b08690aae90fb61beb44e9b06f44fe3d0f93781aaa58cfba86245e" +dependencies = [ + "actix-utils", + "actix-web", + "derive_more", + "futures-util", + "log", + "once_cell", + "smallvec", +] + [[package]] name = "actix-http" version = "3.3.1" @@ -3522,6 +3537,7 @@ dependencies = [ name = "trifid-api" version = "0.1.0" dependencies = [ + "actix-cors", "actix-request-identifier", "actix-web", "aes-gcm", diff --git a/tfweb/src/components/LoadingWrapper.svelte b/tfweb/src/components/LoadingWrapper.svelte index 8475f35..6f61cd6 100644 --- a/tfweb/src/components/LoadingWrapper.svelte +++ b/tfweb/src/components/LoadingWrapper.svelte @@ -1,5 +1,5 @@ + + + {$t("common.title", {values: {title: $t("common.page.login")}})} + + + + {#if isDone} +

{$t('login.email')}

+

{$t('login.emailbody')}

+ +

{@html $t('login.emailbody2', {values:{link0:''+$t('login.emailbody2.link0')+''}})}

+ {:else} +

{$t('login.title')}

+

{$t('login.subtitle')}

+
+ + + + {#if hasErrForm} +

{errForm}

+ {/if} +
+ {/if} +
diff --git a/tfweb/src/routes/magic-link/+page.svelte b/tfweb/src/routes/magic-link/+page.svelte new file mode 100644 index 0000000..4477ed7 --- /dev/null +++ b/tfweb/src/routes/magic-link/+page.svelte @@ -0,0 +1,54 @@ + + + + {$t("common.title", {values: {title: $t("common.page.login")}})} + + + +

{$t('ml.header')}

+

{$t('ml.body')}

+
diff --git a/trifid-api/Cargo.toml b/trifid-api/Cargo.toml index d147c51..711bce2 100644 --- a/trifid-api/Cargo.toml +++ b/trifid-api/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" [dependencies] actix-web = "4" # Web framework actix-request-identifier = "4" # Web framework +actix-cors = "0.6.4" # Web framework serde = { version = "1", features = ["derive"] } # Serialization and deserialization serde_json = "1.0.95" # Serialization and deserialization (cursors) diff --git a/trifid-api/src/main.rs b/trifid-api/src/main.rs index 38b70fb..263b90d 100644 --- a/trifid-api/src/main.rs +++ b/trifid-api/src/main.rs @@ -23,6 +23,7 @@ use log::{info, Level}; use sea_orm::{ConnectOptions, Database, DatabaseConnection}; use std::error::Error; use std::time::Duration; +use actix_cors::Cors; use crate::config::CONFIG; use crate::error::{APIError, APIErrorsResponse}; @@ -75,6 +76,7 @@ async fn main() -> Result<(), Box> { HttpServer::new(move || { App::new() + .wrap(Cors::permissive()) .app_data(data.clone()) .app_data( JsonConfig::default()